Spotify linux woes

spotify

I recently (okay, almost 2 months ago) updated Spotify on my Ubuntu Linux machine, and the new version is having lots of problems:

  • Dragging from search results into a playlist crashes spotify
  • Dragging items to the top or bottom of a playlist crashes Spotify
  • Artist radio isn’t working (or it’s taking so long to load that I gave up waiting)
  • Searching doesn’t display instant search results like it used to

My solution: downgrade spotify. Here goes:

(Note: I’m running Ubuntu 12.04 64-bit. If you’re using 32-bit Ubuntu replace “amd64″ in steps 3 and 6 with “i386″. If you’re using a different version of Ubuntu or a different flavor of Linux, you’re on your own.)

  1. First, completely quit spotify. Make sure you click on the icon and click Exit if it’s in the system tray
  2. Run this command in a terminal to make sure you’ve got the problematic version of Spotify:
    dpkg -l spotify-client
    The output should include this line:
    ii spotify-client 1:0.8.8.323.gd Spotify desktop client
  3. Download the previous version of spotify by running this command in a terminal:
    wget http://packages.bodhilinux.com/bodhi/pool/stable/s/spotify/spotify-client_0.8.4.103.g9cb177b.260-1_amd64.deb
  4. Uninstall the current version:
    sudo dpkg -r spotify-client
  5. Move the cache folder out of the way:
    sudo mv ~/.cache/spotify/ /tmp
    Note: if you don’t do this, you might get this error when running spotify:
    Missing Dependencies
    Framework compatible with bridge-desktop (version 0.7.0) does not exist.
  6. Install the previous version:
    sudo dpkg -i spotify-client_0.8.4.103.g9cb177b.260-1_amd64.deb
    If you get this error:
    dpkg: error processing spotify-client (--install):
    dependency problems - leaving unconfigured

    run this command to fix it by installing any missing dependencies:
    sudo apt-get -f install
  7. To keep spotify from being upgraded again to the broken version, run this command:
    grep -r repository.spotify.com /etc/apt/sources.list* | egrep -v "\.(save|distUpgrade):deb" | cut -f 1 -d :
  8. The previous step should output one or more files. Edit them and put a pound sign (#) in front of any occurrences of this line:
    deb http://repository.spotify.com stable non-free

    Like so:
    #deb http://repository.spotify.com stable non-free

Now spotify should work, at least as well as it did before ;)

Tagged , ,

Enforcing Active Directory password history when resetting passwords using PHP

The code:


$ctrl1 = array(
    // LDAP_SERVER_POLICY_HINTS_OID for Windows 2012 and above
    "oid" => "1.2.840.113556.1.4.2239",
    "value" => sprintf("%c%c%c%c%c", 48, 3, 2, 1, 1));
$ctrl2 = array(
    // LDAP_SERVER_POLICY_HINTS_DEPRECATED_OID for Windows 2008 R2 SP1 and above
    "oid" => "1.2.840.113556.1.4.2066",
    "value" => sprintf("%c%c%c%c%c", 48, 3, 2, 1, 1));
if (!ldap_set_option($a, LDAP_OPT_SERVER_CONTROLS, array($ctrl1, $ctrl2))) {
    error_log("ERROR: Failed to set server controls");
}

$result = ldap_mod_replace($ds, $dn, $entry);
...

Details:

There are a couple of ways to reset Active Directory passwords using LDAP:

  1. A delete operation on the unicodePwd attribute immediately followed by an add, which is a password change
  2. A modification of the unicodePwd attribute, which is considered an administrative password reset

When doing the latter, password history requirements may not be enforced. Apparently this is expected behavior. The solution is a server control:

  1. First, the control must be available on the server. It’s present in Windows Server 2008 R2 Service Pack 1 and above. It can also be installed in 2008 R2 using this hotfix: http://support.microsoft.com/?id=2386717
  2. Next, the client must use the control to tell the AD server to enforce password history requirements.

If you happen to be doing this in PHP, the solution for the second part is the code I’ve posted. The tricky part was to get the BER encoding for the value correct.

I put both controls (the new one as well as the deprecated one) in my code and also didn’t set the iscritical flag (which defaults to false) in order to make the code as flexible as possible.

Here are the sources I used:

In case you’re looking to implement a solution to reset AD passwords using PHP, you may find these helpful:

Tagged ,

RHEL 6 kickstart maps first hard drive to /dev/sdc

I was installing RHEL 6 on a Dell PowerEdge R610, and for some strange reason the first drive was mounted as /dev/sdc instead of /dev/sda. I saw someone else had the same issue on CentOS 6:

https://www.centos.org/modules/newbb/viewtopic.php?topic_id=36632

The solution: disable the iDRAC virtual media. I had to press Ctrl-E to get into the DRAC menu when it prompted me during the boot process, then I had to arrow down to Virtual Media Configuration and change the Virtual media setting from attached to detached.

Or from the iDRAC web interface: System –> Console/Media –> Configuration –> Virtual media –> Status –> change to Detach –> Apply

Now the first drive is mapped as /dev/sda again.

Tagged , ,

Dell DSET: Failed to gather Chassis/Storage data.

Trying to run Dell’s DSET tool on Linux (RHEL), if it fails with the following error after entering the root password:

Failed to gather Chassis/Storage data. Check the IP Address, credentials and namespace.

Make sure you entered the root password correctly. Reset the root password if you’re not 100% sure.

Tagged , ,

Planetside 2 newbie guide

704
Planetside 2 is a great game, but there is no official documentation, and there were a few things that were unclear to me when I first started playing the game, so I thought I’d share my findings:

Capturing bases

Each base has capture points that you can see on the map and your display as letters (A, B, C, etc). To capture a capture point, just stand close to it until it turns your empire’s color. Then a meter will show up with the enemy’s color which will gradually go down, followed by one with your color which will gradually go up, and then you’ve captured the base. The enemy can reverse this process by recapturing the capture points.

Generators

Main bases (bio labs, tech plants, amp stations) have generators that power the shields. There is also a special unit called an SCU (Spawn Control Unit) that determines whether or not you can spawn at a base.

  • Overloading (destroying) enemy generators

    To overload an enemy base’s generator, just stand near it and hold the E key when prompted. No special items or certs are required. And no, shooting at them won’t do anything (common newbie mistake).

  • Repairing generators

    Once an enemy base has been captured, you can repair any destroyed generators. This must be done by an engineer using the nano armor kit (which can also be used to repair vehicles, turrets, and MAXes).

Hacking enemy terminals/turrets

Only the infiltrator class can hack enemy terminals. Hacking terminals doesn’t require any special items or certs. An infiltrator can simply approach an enemy’s terminal and hold the E key when prompted to hack it so that it can be used by that person’s empire. The same goes for enemy turrets–pretty cool, huh? In addition, if an enemy is in a turret when you hack it, they will get kicked out once the hack is complete.

Deploying spawn beacons

If you are a squad leader, you can get the Spawn Beacon cert which will give you an extra item in your inventory (it will be the last item) that can be used to deploy a spawn beacon where your squad members can spawn.

Certs and cert points

  • Offline cert points

    Cert points will be accumulated even when you aren’t playing the game. Currently about one cert point is acquired every two hours when offline, up to a current maximum of 12 cert points.

  • Auto granted certs

    Some of your certs will show up as “Auto Granted.” It seems there are some certs that have a cost of 0 cert points, and you’re given them automatically. My guess is maybe these certs used to cost something but they repriced them as they’ve been modifying the game during beta.

Spotting enemies

If you see an enemy, you can spot them out by placing your crosshairs over them and pressing the Q key (it may help to press it repeatedly). You will call out to friendly troops that an enemy has been spotted, and you may get some XP if someone from your empire kills that enemy soon afterward.

Deploying a sunderer

By default, you cannot deploy a sunderer. You must first get the Sunderer Advanced Mobile Station (S-AMS) cert, and then add the S-AMS attachment to your sunderer before spawning it. Then you can deploy the sunderer while sitting in the front seat by pressing the B key.

You cannot deploy a sunderer within 200m of another deployed friendly sunderer.

Special abilities

Most classes have special abilities that can be activated.

  • Infiltrator

    Infiltrators can temporarily become invisible by pressing the ability key (F).

  • Light assault

    Light assaults have jump-jets that can be activated by holding down the jump key (spacebar).

  • Medic

    Medics have an ability that heals people in the nearby vicinity that is activated by pressing the ability key (F).

  • Heavy Assault

    Heavy Assaults have a special shield that can be activated by pressing the ability key (F).

  • MAX

    MAXes can charge forward a short distance by pressing the ability key (F).

Third-person vehicle view

The default key for third-person view when in a vehicle is T. You may not be able to switch to third-person view immediately after spawning; wait a few seconds and try again.

Tagged , ,

Elementary luna beta1 non PAE live CD

I booted up the elementary luna beta1 live CD today, only to be greeted by this error:

This kernel requires the following features not present on the CPU:
pae

Unable to boot - please use a kernel appropriate for your CPU.

After fumbling around for a while, I was finally able to make my own non-PAE image. I’m not sure how well it will work for others, because the installation itself seems to install a PAE kernel, but it worked fine on my machine that was giving me the above error and doesn’t support PAE (at least according to cat /proc/cpuinfo | grep -i pae). Here’s the link:

http://uploading.com/files/get/f5cdcc7c/elementaryos-beta1-i386-nonpae.20121114.iso

If there’s a better site to upload it to, let me know. I’d put it in dropbox but there’s a daily bandwidth limit, and I don’t want my account flagged for abuse.

Tagged ,

Elementary luna beta1 is here!

Elementary linux luna beta1 is finally here!:

Hello, Luna Beta 1

Don’t know what elementary is? It’s linux with a crisp, clean, and consistent UI (user interface) and a unified UX (user experience). It’s basically everything linux should be. Read more about it at the link above, or you can check out some of my posts on elementary:

http://bmaupin.wordpress.com/tag/elementary/

Now stop reading this and go download it!

Tagged ,

OpenLDAP mdb backend ready for production

OpenLDAP’s new memory-mapped backend, mdb, is ready for production. It was first introducted over a year ago, and since then, the OpenLDAP developers (Howard Chu in particular) have put quite a bit of work into getting all of the bugs worked out.

The OpenLDAP mailing lists report that several companies are deploying it in production:

http://www.openldap.org/lists/openldap-technical/201208/msg00137.html

The latest version of email/collaboration software Zimbra uses the mdb backend as well:

http://wiki.zimbra.com/wiki/OpenLDAP_Tuning_Keys_8.0#OpenLDAP_Tuning_Keys

All of this leads me to believe it’s production-ready. I’ve been running it myself at my own job for a couple weeks now, and it’s actually lived up to the hype. It really is faster, uses less memory, and is way easier to configure. You can read more about the advantages of mdb here: coming soon: memory-mapped db for OpenLDAP

Here’s a short list of what I would consider the caveats:

  • Since it’s new technology, I highly recommend compiling the latest version of OpenLDAP (as of this posting 2.4.33) to get the latest bug fixes and performance improvements. I have a page of useful tips for compiling OpenLDAP to get the most out of it here: compiling OpenLDAP.
  • Write performance is still being optimized. My personal recommendation would be to continue to use hdb on the master server (properly optimized), and mdb on the replica servers.
  • I’m guessing because of the previous point, it can take quite a bit longer to do the initial database load. Using hdb it took a few hours to slapadd our database, but it’s taking around 12 hours to slapadd it using mdb. It’s worth the wait, though.
    (see comments)

I’ve updated my wiki on optimizing OpenLDAP with instructions for mdb. Instead of worrying about locks and three different levels of caches, there’s just one important option which is trivial to configure:

Optimizing OpenLDAP

More information about mdb is available here:

http://highlandsun.com/hyc/mdb/

Now, if Symas would only post some updated benchmarks, I could point to just how much faster OpenLDAP is than the competition…

Tagged ,

sudo -s on RHEL 6 doesn’t preserve HOME

solution:

if you’re the only one using this machine, the easiest fix is to run this command as root:
visudo
and then add this line to the sudoers file:
Defaults env_keep=HOME

if this is a shared computer and you aren’t at liberty to change the sudoers file, you can add this code to .bashrc in your home directory. be sure to log out and back in for it to take effect:

# hack to preserve home when using sudo -s on rhel 6
if [[ `cat /etc/*release | grep "release 6"` ]]; then
    sudo() {
        if [[ $@ == "-s" ]]; then
            sudo bash -c "HOME=$HOME; exec bash"
        else
            command sudo "$@";
        fi;
    }
fi;

details:

in linux, if I want to become root but keep my user’s environment (home, aliases, etc), I normally use sudo -s:
[user@computer ~]$ sudo -s
[root@computer ~]# echo $HOME
/home/user

and if I want to become root and use root’s environment, I’ll use sudo -i:
[user@computer ~]$ sudo -i
[root@computer ~]# echo $HOME
/root

the above works on Ubuntu, and all versions of RHEL up to 5 (the same probably goes for CentOS). however, I recently noticed that RHEL 6 , my home variable isn’t preserved when using sudo -s:
[user@computer ~]$ sudo -s
[root@computer user]# echo $HOME
/root

the most frustrating thing is that because of this, it seems like my .bashrc wasn’t being called, and so I didn’t have access to my aliases any more.

it seems like the cause of this is that the default in RHEL 6 is not to preserve the home variable. you can see this running this command as root:
sudo -V
if you look under the list of “Environment variables to preserve,” you’ll notice that in RHEL 5 HOME is listed, but in RHEL 6 it isn’t.

Tagged ,

uninstalling problematic rpms

if you’re unable to uninstall an rpm using yum erase/remove or rpm -e because something in the rpm’s uninstallation process is broken, try using rpm -e with the --noscripts --notriggers flags:


$ sudo rpm -e sblim-sfcb
/var/tmp/rpm-tmp.54035: line 7: /etc/init.d/sfcb: No such file or directory
error: %preun(sblim-sfcb-1.3.11-0.7.14.x86_64) scriptlet failed, exit status 127
$ sudo yum remove sblim-sfcb
...
Running Transaction
/var/tmp/rpm-tmp.49575: line 7: /etc/init.d/sfcb: No such file or directory

Removed:
sblim-sfcb.x86_64 0:1.3.11-0.7.14

Complete!
$ rpm -qa sblim-sfcb
sblim-sfcb-1.3.11-0.7.14
$ sudo rpm -e sblim-sfcb --noscripts --notriggers
$ rpm -qa sblim-sfcb
$

Tagged ,
Follow

Get every new post delivered to your Inbox.