Tuesday, August 7, 2012

Fedora core 17 and spotify-client_0.8.4.103.g9cb177b.260-1_amd64.deb

Ok, I love spotify. I even have a paid subscription.  I Just started using Fedora Core 17 and Spotify doesn't produce an rpm install; only .deb. You can convert .deb to rpm with 'alien' so that's not a problem.  A few tutorials already exist but figured I'd throw another one into the mix.

First you want the spotify .deb:

http://repository.spotify.com/pool/non-free/s/spotify/

Next, you probably will need alien if its not installed already.  At the time I did in the A.M the git repo was not responding so I downloaded the source tarball from here:

http://packages.debian.org/unstable/source/alien

Next you compile and install alien. Then convert the deb to rpm:

 cd ~/Downloads  #My package was downloaded here. Yours could be different.
 tar -xvzf alien_8.87.tar.gz  
 cd alien  
 perl Makefile.PL  
 make  
 sudo make install  #you can actually use alient without having to install if you prefer
 cd ~/Downloads  
 su -c 'alien --to-rpm ./spotify-client_0.8.4.103.g9cb177b.260-1_amd64.deb'  
 sudo rpm -ivh --nodeps spotify-client-0.8.4.103.g9cb177b.260-2.x86_64.rpm

But we aren't finished. You will get a ton of library failures if you try and run spotify. You can check yours with ldd. Your output might be a little different.

 ldd /usr/bin/spotify |grep "not found"  
   libssl.so.0.9.8 => not found  
   libcrypto.so.0.9.8 => not found  
   libnss3.so.1d => not found  
   libnssutil3.so.1d => not found  
   libsmime3.so.1d => not found  
   libplc4.so.0d => not found  
   libnspr4.so.0d => not found  

I already had fixed one dependancy before I took the ldd snapshot, and thats phonon.  'yum install phonon' should take care of that for you.

As for the rest, someone put together a nice compilation of the spotify libs together, with a short script to start spotify pointing to these libraries. Why are we doing this? One is FC17 uses a newer version of libssl. Spotify is using an older version. Downgrading it just for spotify might cause quite a few problems. So a second set of libraries will get it working.

*******
Part of the information below and tarball regarding the spotify libraries are from this blog:
http://xunlinkx.blogspot.com/2012/06/install-spotify-in-fedora-fc17-walien.html

Please visit it if you want a more expanded version of the instructions regarding the library files.
********

Download and extract this tarball:

http://dl.dropbox.com/u/17435887/CentOS6/andersx/spotify_libs.tar.gz

Modify the spotify.sh to where you moved your libraries.

Mine looks like so:
 cat spotify.sh   
 #!/bin/bash  
 export LD_LIBRARY_PATH=/home/spacehat/libs/spotify_libs  
 /usr/bin/spotify  


If you aren't familiar with LD_LIBRARY_PATH, a simple explanation is it provides a way to override the system default paths of library files. A program will look to the path your provide FIRST, and then onto the previous system defaults.  So in our instance, we are using it to tell Spotify to look at our custom set of library files first. Showing the libraries that were previously not found:

 ldd /usr/bin/spotify |grep spacehat  
   libQtWebKit.so.4 => /home/spacehat/libs/spotify_libs/libQtWebKit.so.4 (0x00007fa9b87a4000)  
   libssl.so.0.9.8 => /home/spacehat/libs/spotify_libs/libssl.so.0.9.8 (0x00007fa9b5240000)  
   libcrypto.so.0.9.8 => /home/spacehat/libs/spotify_libs/libcrypto.so.0.9.8 (0x00007fa9b4eb0000)  
   libnss3.so.1d => /home/spacehat/libs/spotify_libs/libnss3.so.1d (0x00007fa9b4071000)  
   libnssutil3.so.1d => /home/spacehat/libs/spotify_libs/libnssutil3.so.1d (0x00007fa9b3e51000)  
   libsmime3.so.1d => /home/spacehat/libs/spotify_libs/libsmime3.so.1d (0x00007fa9b3c25000)  
   libplc4.so.0d => /home/spacehat/libs/spotify_libs/libplc4.so.0d (0x00007fa9b3a20000)  
   libnspr4.so.0d => /home/spacehat/libs/spotify_libs/libnspr4.so.0d (0x00007fa9b37e3000)  

*******
Part of the information above and tarball regarding the spotify libraries are from this blog:
http://xunlinkx.blogspot.com/2012/06/install-spotify-in-fedora-fc17-walien.html

Please visit it if you want a more expanded version of the instructions regarding the library files. 
*******


Monday, August 6, 2012

Fedora Core Install.

I used RHEL when I first started playing with Linux over 10 years ago.  I picked up a book and cd of Redhat 5.2 in a half-priced books. Why? Because I wanted to compile and run show-EQ. That's what started my foray into the linux world; to gain an advantage in a video game. I've used RHEL on servers, but on my desktop / laptop I haven't used a RHEL / RPM based distro since.  I've primarily done debian based, gentoo, and now Arch. I like apt and pacman; more specifically AUR wrapper, yaourt.

I've always thought Fedora was an interesting distro with a good community. I also had this bad biased view it was bloated. Compared to my pretty stripped down install of Arch using just Awesome as my desktop, most distros feel pretty bloated. Maybe I can change that opinion so I backed up my arch install, wiped the drive and installed FC: Xfce spin.

Install was simple, smooth and fairly fast. First thing was running an update after the install. 700+ package update. I can't say if yum is faster or slower than apt due to the size of this initial update. I guess I'll be able to formulate a better opinion as time goes on.

Next I added the virtualization client group. At the time of the writing I have not finished setting up a KVM of Windows 7, but hopefully will do shortly as I would like to try PCI passthrough.

My biggest issue is not because of the distro or xfce directly; but because I've gotten so used to Awesome.  I've become heavily reliant on key combinations for movement, program use etc.  Having to rely on the mouse again is a hinderance. Seems I need to go through and setup some key combinations to get a similar feel back.

More to FC later...

Sunday, July 29, 2012

Windows World: zero touch install part 1.

The problem: Zero touch Windows OS install without using Microsoft' SCCM. 


*This was for Windows XP that was being re-deployed. This was not an upgrade to Windows 7. The XP image was also already created ahead of time with a completed answer file. The mission was to get it onto the target computers.


Part 1: PXE Boot. 

The first task I decided to tackle was how to get the machines to PXE boot remotely and without user intervention. With a short call and a few questions later I learned all the machines were HP and that made it simple. HP offers a package that exposes the BIOS settings to WMI. The code to change the boot setting is even provided to you by HP.

Here is the snippet of code doing the actual changing. It sets PXE boot to enable, then sets network boot to first boot choice.
1: Set objWMIService = GetObject("winmgmts:{impersonationlevel=impersonate}//./root/HP/InstrumentedBIOS")
2: Set colItems = objWMIService.ExecQuery("select * from HP_BIOSSettingInterface",,48)
3: For each objItem in colItems
4:     objItem.SetBiosSetting oReturn, "Network Service Boot", "Enable" ,"<kbd/>"
5:     if oReturn then
6:         wscript.echo "Network Service Boot" & " Can not be set, Error=" & ErrCode(oReturn)
7:         wscript.quit(oReturn )
8:     end if
9:     objItem.SetBiosSetting oReturn, "Boot Order", "Network Controller,Hard Drive,USB device,USB device,ATAPI CD-ROM Drive" ,"<kbd/>"
10:    if oReturn then
11:        wscript.echo "Boot Order" & " Can not be set, Error=" & ErrCode(oReturn)
12:        wscript.quit(oReturn )
13:    end if
14: Next

To get the code, or view more things to be done through the WMI: Read Hp's technical whitepaper with the full information.  


Since Windows Server 2008 was already in place, Windows Deployment Services could be used as the actually deployment piece. It's part of Server 2008 as a role you can install. I decided to build a small lab to understand and learn WDS. I also download the WAIK 3.x kit to mess with the Windows boot loaders. 


After an afternoon of playing around I was able to deploy the image to the HP machine. I could even run the script remotely changing the boot order, then reboot the machine and watch it PXE boot. Soon another problem reared it's head: After the machine is rebooted it's still set to PXE boot. We are now stuck in a perpetual boot loop. The HP utilities have to be installed to change BIOS settings.


Part 2 coming soon.
Decided to start a small blog to keep track of some of the things I've done. Also, rewriting important pieces of information helps me retain it longer.  I am a Systems Admin that has worked with Linux, Solaris Unix, NCR Unix,  and Windows Server 2003/8/R2. The first thing I will blog about is actually going to be a ZTI install I did in a windows environment. I consider Linux/Unix my strong point, but it was a task I opted to try and in the end the solution worked wonderfully. So, I thought I would share it first.

-spacehat.