One step closer to world domination
Perl
perl-Net-SSLeay dependency error when installing Memcached with yum
Dec 3rd
Today while configuring another production CentOS 5.5 machine I ran into a problem where memcached refused to install.
[root@localhost ~]# yum install memcached
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* rpmforge: apt.sw.be
rpmforge | 1.1 kB 00:00
rpmforge/primary | 2.2 MB 00:01
rpmforge 10361/10361
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package memcached.i386 0:1.4.5-1.el5.rf set to be updated
--> Processing Dependency: perl(AnyEvent) for package: memcached
--> Processing Dependency: perl(AnyEvent::Socket) for package: memcached
--> Processing Dependency: perl(AnyEvent::Handle) for package: memcached
--> Processing Dependency: libevent-1.1a.so.1 for package: memcached
--> Processing Dependency: perl(YAML) for package: memcached
--> Processing Dependency: perl(Term::ReadKey) for package: memcached
--> Running transaction check
---> Package compat-libevent-11a.i386 0:3.2.1-1.el5.rf set to be updated
---> Package perl-AnyEvent.noarch 0:5.240-1.el5.rf set to be updated
--> Processing Dependency: perl(JSON::XS) >= 2.2 for package: perl-AnyEvent
--> Processing Dependency: perl(JSON) >= 2.09 for package: perl-AnyEvent
--> Processing Dependency: perl(EV) >= 3.05 for package: perl-AnyEvent
--> Processing Dependency: perl(Guard) >= 1.02 for package: perl-AnyEvent
--> Processing Dependency: perl(Net::SSLeay) >= 1.33 for package: perl-AnyEvent
---> Package perl-TermReadKey.i386 0:2.30-3.el5.rf set to be updated
---> Package perl-YAML.noarch 0:0.71-1.el5.rf set to be updated
--> Running transaction check
---> Package perl-AnyEvent.noarch 0:5.240-1.el5.rf set to be updated
--> Processing Dependency: perl(Net::SSLeay) >= 1.33 for package: perl-AnyEvent
---> Package perl-EV.i386 0:3.9-1.el5.rf set to be updated
--> Processing Dependency: perl(common::sense) for package: perl-EV
---> Package perl-Guard.i386 0:1.021-1.el5.rf set to be updated
---> Package perl-JSON.noarch 0:2.17-1.el5.rf set to be updated
---> Package perl-JSON-XS.i386 0:2.27-1.el5.rf set to be updated
--> Running transaction check
---> Package perl-AnyEvent.noarch 0:5.240-1.el5.rf set to be updated
--> Processing Dependency: perl(Net::SSLeay) >= 1.33 for package: perl-AnyEvent
---> Package perl-common-sense.i386 0:3.0-1.el5.rf set to be updated
--> Finished Dependency Resolution
perl-AnyEvent-5.240-1.el5.rf.noarch from rpmforge has depsolving problems
--> Missing Dependency: perl(Net::SSLeay) >= 1.33 is needed by package perl-AnyEvent-5.240-1.el5.rf.noarch (rpmforge)
Error: Missing Dependency: perl(Net::SSLeay) >= 1.33 is needed by package perl-AnyEvent-5.240-1.el5.rf.noarch (rpmforge)
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.
CentOS’s yum repository doesn’t have the latest perl-Net-SSLeay and perl-IO-Socket-SSL packages that are required by memcached. I did some Googling to find that others were experiencing a similar problem without resolution. Here’s the simple fix:
First, remove the old perl modules. Then download and install the newer versions that memcached requires.
rpm-e perl-Net-SSLeay-1.30-4.fc6
rpm -e perl-IO-Socket-SSL-1.01-1.fc6
wget http://packages.sw.be/perl-Net-SSLeay/perl-Net-SSLeay-1.36-1.el5.rfx.i386.rpm
wget http://packages.sw.be/perl-Net-SSLeay/perl-Net-SSLeay-1.36-1.el5.rfx.x86_64.rpm
wget http://packages.sw.be/perl-IO-Socket-SSL/perl-IO-Socket-SSL-1.34-1.el5.rfx.noarch.rpm
rpm -i perl-Net-SSLeay-1.36-1.el5.rfx.x86_64.rpm
rpm -i perl-Net-SSLeay-1.36-1.el5.rfx.i386.rpm
rpm -i perl-IO-Socket-SSL-1.34-1.el5.rfx.noarch.rpm
Now you should be able to install memcached without error.
yum -y install memcached
If you experience an error removing either of the packages then you can try greping to see if you have other versions installed.
rpm -qa | grep perl-Net-SSLeay
and
rpm -qa | grep perl-IO-Socket-SSL
Facebook-Status-2.0 announced!
Feb 10th
I have updated my original Facebook status script to work with Facebook 2.0.
Why is this interesting? Until recently the Facebook Developer Platform didn’t allow the changing of user status messages. This does and can be implemented in other utilities, which I may do in the future. Enjoy!
Update Your Facebook Status from the Command Line
Nov 24th
The Facebook Developer Platform doesn’t give us the ability to set a user’s status so I decided to write my own method that would allow Facebook users to update their status messages without having to log into the website.
The first version that I wrote in 2006 was a little complicated. The script had to connect to several Facebook pages and collect cookies and challenge codes that were necessary to login and update the user’s status.
Facebook changed their login and status update mechanisms in version 2.0 breaking my original script. I’ve rewritten it to work with Facebook 2.0. It is now actually shorter because Facebook uses the user’s homepage as the central information area.
Any feedback is welcome. I plan to implement this in other utilities soon. Enjoy!
Updated on September 9, 2011 to version 2.2
#!/usr/bin/perl -w #=============================================================================== # # Facebook status script v2.2 # # This script allows you to update your Facebook status from the shell. # # Copyright (C) 2011 Matt West <matt at mattdanger dot net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # For a copy of the GNU General Public License visit <http://www.gnu.org/licenses/>. # #=============================================================================== # Be sure you have installed the LWP and Crypt::SSLeay packages from CPAN use LWP; use HTTP::Cookies; use Term::ReadKey; use strict; # General vars my $login; my $password; my $status; my $auth_key; my $fb_dtsg; my $response; my $user_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6"; my @header = ( 'Referer' => 'http://www.facebook.com/', 'User-Agent' => $user_agent); my $cookie_jar = HTTP::Cookies->new( file => 'cookies.dat', autosave => 1, ignore_discard => 1); my $browser = LWP::UserAgent->new; $browser->cookie_jar($cookie_jar); # Get login information & the status message to send. print "Facebook login name: "; $login = <>; chomp($login); print "Password: "; ReadMode('noecho'); $password = ReadLine(0); chomp($password); ReadMode 0; print "\nYour status (Facebook appears to have a 232 character limit): "; $status = <>; chomp($status); print "\nSending... "; #================================================ # Login and get auth key #================================================ $response = $browser->post('https://www.facebook.com/login.php?m=m&refsrc=http%3A%2F%2Fm.facebook.com%2Fhome.php&refid=8', ['email' => $login, 'pass' => $password, 'login' => 'Log In'], @header); $cookie_jar->extract_cookies( $response ); $cookie_jar->save; $response = $browser->get('http://m.facebook.com/home.php', @header); $auth_key = $response->content; $auth_key =~ s/\n//g; $auth_key =~ s/^.*name="post_form_id" value="//; $auth_key =~ s/".*$//; $fb_dtsg = $response->content; $fb_dtsg =~ s/\n//g; $fb_dtsg =~ s/^.*name="fb_dtsg" value="//; $fb_dtsg =~ s/".*$//; #================================================ # Submit the status update #================================================ @header = ('Referer' => 'http://m.facebook.com/a/home.php', 'User-Agent' => $user_agent, 'Host' => 'm.facebook.com'); $response = $browser->post('http://m.facebook.com/a/home.php?re974fcaf&refid=7&rbb94a931', ['fb_dtsg' => $fb_dtsg, 'post_form_id' => $auth_key, 'status' => $status, 'update' => 'Share'], @header); # Did we do good here? if ($response->content eq '') { print "Done!\n\n"; } else { print "An error occurred while setting your profile status.\n\n"; $response->content; } # Now that we're done we can delete the cookies.dat file. exec('rm cookies.dat');










