Sunday, November 20, 2011

Fixing Redmine user page-load-error on Debian 6

For those who are using redmine on debian-6.0, and using redmine might see problem using it, when we try to visit the user page.

Error look something like this.


ActionView::TemplateError (undefined method `html_safe' for "user@mycompany.com":String) on line #10 of app/views/users/show.rhtml:
Solution to this problem is to apply this patch.



redmine-server:/usr/share/redmine# diff /usr/lib/ruby/1.8/action_view/helpers/url_helper.rb /usr/lib/ruby/1.8/action_view/helpers/url_helper.rb.orig 476,477c476<           #html = content_tag("a", name || email_address_obfuscated.html_safe, html_options.merge({ "href" => "mailto:"+html_escape(email_address)+extras }))<                 html = content_tag("a", name || html_escape(email_address_obfuscated), html_options.merge({ "href" => "mailto:"+html_escape(email_address)+extras }))--->           html = content_tag("a", name || email_address_obfuscated.html_safe, html_options.merge({ "href" => "mailto:"+html_escape(email_address)+extras }))mdserver1:/usr/share/redmine# 

Monday, October 31, 2011

Building Facebook's HipHop on Fedora 15

Facebook has opensourced their Hiphop code transformer. Simply put Hiphop transforms your code written in PHP Language into Machine Language. So this post is mainly for PHP Developers and Others who want to get their hands dirty with Hiphop on Fedora 15.

Before you get started. Please visit the main home page of the hiphop Project itself.

On github you see the list of all the pre-requisites. First lets get our development environment ready.


Prerequisites.

You need a Fedora 15 64-bit installation. You need not install anything. Just install the Live CD and follow these steps to get the things done.

1. Install the Fedora Packager packages


[root@nareshv-build64 ~]# yum groupinstall "Fedora Packager"


2. Make sure you have git and c++ compiler


[root@nareshv-build64 ~]# yum install gcc-c++ git wget 


3. Install all the pre-requisites as mentioned in the hiphop wiki

[root@nareshv-build64 ~]# yum install zlib-devel   \
xorg-x11-devel   \
libXau-devel   \
libxcb-devel   \
libX11-devel   \
libXpm-devel   \
freetype-devel   \
fontconfig-devel   \
libcom_err-devel   \
libjpeg-turbo   \
2:libpng-devel   \
libsepol-devel   \
libselinux-devel   \
keyutils-libs   \
krb5-devel   \
openssl-devel   \
mysql-devel   \
gd-devel   \
boost-devel   \
libcap-devel   \
oniguruma-devel   \
pcre-devel   \
libicu-devel   \
binutils-devel   \
libxml2-devel   \
libmcrypt-devel   \
expat-devel   \
libstdc++-devel   \
glibc-devel   \
tbb-devel   \
cyrus-sasl   \
libmemcached-devel   \
bzip2-devel   \
openldap-devel   \
ncurses-devel   \
readline-devel   \
pam-devel   \
uw-imap-devel   \
systemtap-sdt   \
libaio-devel   \
mysql-devel   \
jemalloc-devel


4. Now we have to build libevent-1.4 and curl packages on our own as facebook has made some patches to those packages.

5. Lets create the environment for building the packages

6. Create workspace for checking out the hiphop source code.


[root@nareshv-build64 ~]# cd $HOME/
[root@nareshv-build64 ~]# mkdir -p $HOME/dev/hiphop/ $HOME/dev/hiphop/usr
[root@nareshv-build64 ~]# cd $HOME/dev/hiphop


7. Checkout the hiphop source code


[root@nareshv-build64 ~]# cd $HOME/dev/hiphop/ && git clone git://github.com/facebook/hiphop-php.git



8. Download curl and libevent for building locally


[root@nareshv-build64 ~]# cd $HOME/dev/hiphop/
[root@nareshv-build64 hiphop]# wget http://curl.haxx.se/download/curl-7.20.0.tar.bz2
[root@nareshv-build64 hiphop]# wget http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz

[root@nareshv-build64 hiphop]# tar jxf curl-7.20.0.tar.bz2
[root@nareshv-build64 hiphop]# tar zxf libevent-1.4.13-stable.tar.gz

[root@nareshv-build64 hiphop]# cd libevent-1.4.13-stable
[root@nareshv-build64 libevent-1.4.13-stable]# cp ../hiphop-php/src/third_party/libevent-1.4.13.fb-changes.diff .
[root@nareshv-build64 libevent-1.4.13-stable]# patch < libevent-1.4.13.fb-changes.diff
[root@nareshv-build64 libevent-1.4.13-stable]# export CMAKE_PREFIX_PATH=$HOME/dev/hiphop/usr
[root@nareshv-build64 libevent-1.4.13-stable]# make
[root@nareshv-build64 libevent-1.4.13-stable]# make install
[root@nareshv-build64 libevent-1.4.13-stable]# cd $HOME/dev/hiphop/

[root@nareshv-build64 hiphop]# cd curl-7.20.0
[root@nareshv-build64 curl-7.20.0]# cp ../hiphop-php/src/third_party/libcurl.fb-changes.diff .
[root@nareshv-build64 curl-7.20.0]# patch -p0 < libcurl.fb-changes.diff

# While applying patch, it will ask for which file to patch. Type in the names without the .new and .old paths. 
# Example: include/curl/multi.h and 
# Example: lib/multi.c
# After this, patch will be applied correctly.

[root@nareshv-build64 curl-7.20.0]# ./configure --prefix=$HOME/dev/hiphop/usr/
[root@nareshv-build64 curl-7.20.0]# make
[root@nareshv-build64 curl-7.20.0]# make install
[root@nareshv-build64 curl-7.20.0]# cd $HOME/dev/hiphop/


9. Now get ready to build hiphop itself


[root@nareshv-build64 curl-7.20.0]# cd $HOME/dev/hiphop/hiphop-php
[root@nareshv-build64 hiphop-php]# export CMAKE_PREFIX_PATH=$HOME/dev/hiphop/usr/
[root@nareshv-build64 hiphop-php]# git submodule init
[root@nareshv-build64 hiphop-php]# git submodule update
[root@nareshv-build64 hiphop-php]# export HPHP_HOME=`pwd`
[root@nareshv-build64 hiphop-php]# export HPHP_LIB=`pwd`/bin
[root@nareshv-build64 hiphop-php]# cmake .
[root@nareshv-build64 hiphop-php]# make


10. You will encounter some errors related to 'c-client version should be higher than 2007'.

On fedora the package is called libc-client and libc-client-devel and the includes are present in /usr/include/imap/ folders.

Lets adjust the CMakeCache.txt like this.

[root@nareshv-build64 hiphop-php]# cd $HOME/dev/hiphop/hiphop-php/
[root@nareshv-build64 hiphop-php]# vim CMakeCache.txt

 71 //Path to a file.CCLIENT_INCLUDE_PATH:PATH=CCLIENT_INCLUDE_PATH-NOTFOUND
 72 CCLIENT_INCLUDE_PATH:PATH=/usr/include/imap/
 73 
 74 //Path to a library.CCLIENT_LIBRARY:FILEPATH=CCLIENT_LIBRARY-NOTFOUND
 75 CCLIENT_LIBRARY:FILEPATH=/usr/lib64/libc-client.so.2007


11. Build again.

[root@nareshv-build64 hiphop-php]# cd $HOME/dev/hiphop/hiphop-php/
[root@nareshv-build64 hiphop-php]# cmake .
[root@nareshv-build64 hiphop-php]# make


12. Now it will fail at mysql related references like this


[ 88%] Building CXX object src/hphp/CMakeFiles/hphp.dir/externals.cpp.o
Linking CXX executable hphp
../../bin/libhphp_runtime.a(ext_mysql.cpp.o): In function `HPHP::php_mysql_do_query_general(HPHP::String const&, HPHP::Variant const&, bool)':
ext_mysql.cpp:(.text+0x8109): undefined reference to `cli_safe_read'
ext_mysql.cpp:(.text+0x822c): undefined reference to `net_field_length'
ext_mysql.cpp:(.text+0x83a0): undefined reference to `cli_safe_read'
ext_mysql.cpp:(.text+0x8675): undefined reference to `free_root'
collect2: ld returned 1 exit status
gmake[2]: *** [src/hphp/hphp] Error 1
gmake[1]: *** [src/hphp/CMakeFiles/hphp.dir/all] Error 2
gmake: *** [all] Error 2


After investigating for a couple of hours. found that this issue is related to the way mysql rpm is built in fedora distribution. Somehow i managed to overcome this problem by doing the following things.

12.1 Download the mysql .src.rpm from koji

I went to http://koji.fedoraproject.org/koji/buildinfo?buildID=268920

and downloaded the following .src.rpm

http://kojipkgs.fedoraproject.org/packages/mysql/5.5.16/3.fc17/src/mysql-5.5.16-3.fc17.src.rpm

12.2 Install the .src.rpm as 'fedora' user (It can be root also. I did it as fedora user. But you got the point)


[root@nareshv-build64 hiphop-php]# rpm -Uvh mysql-5.5.16-3.fc17.src.rpm


12.3 Update the libmysql.version file


[root@nareshv-build64 hiphop-php]# cd /home/fedora/rpmbuild/SOURCES/
[root@nareshv-build64 SOURCES]# ls
filter-requires-mysql.sh    mysql-disable-test.patch     mysql-errno.patch          mysql-strmov.patch
generate-tarball.sh         mysqld-nowatch.patch         mysql-expired-certs.patch  mysql.tmpfiles.d
libmysql.version            mysqld-prepare-db-dir        mysql-install-test.patch   mysql-va-list.patch
my.cnf                      mysqld.service               mysql-openssl-test.patch   mysql-versioning.patch
my_config.h                 mysql-dubious-exports.patch  mysql-plugin-bool.patch    README.mysql-docs
mysql-5.5.16-nodocs.tar.gz  mysqld-wait-ready            mysql-s390-tsc.patch       README.mysql-license
mysql-chain-certs.patch     mysql-embedded-check.c       mysql-stack-guard.patch    scriptstub.c
[root@nareshv-build64 SOURCES]# tail libmysql.version 
 mysql_get_charset_by_csname;
 mysql_net_realloc;
# PHP's mysqli.so requires this (via the ER() macro)
 mysql_client_errors;
# Hiphop needs it
 cli_safe_read;
 net_field_length;
 cli_safe_read;
 free_root;
};


12.4 Rebuild the RPM

[fedora@nareshv-build64 SOURCES]$ rpmbuild -bb ../SPECS/mysql.spec 
...
...
Wrote: /home/fedora/rpmbuild/RPMS/x86_64/mysql-5.5.16-3.fc15.x86_64.rpm
Wrote: /home/fedora/rpmbuild/RPMS/x86_64/mysql-libs-5.5.16-3.fc15.x86_64.rpm
Wrote: /home/fedora/rpmbuild/RPMS/x86_64/mysql-server-5.5.16-3.fc15.x86_64.rpm
Wrote: /home/fedora/rpmbuild/RPMS/x86_64/mysql-devel-5.5.16-3.fc15.x86_64.rpm
Wrote: /home/fedora/rpmbuild/RPMS/x86_64/mysql-embedded-5.5.16-3.fc15.x86_64.rpm
Wrote: /home/fedora/rpmbuild/RPMS/x86_64/mysql-embedded-devel-5.5.16-3.fc15.x86_64.rpm
Wrote: /home/fedora/rpmbuild/RPMS/x86_64/mysql-bench-5.5.16-3.fc15.x86_64.rpm
Wrote: /home/fedora/rpmbuild/RPMS/x86_64/mysql-test-5.5.16-3.fc15.x86_64.rpm

Wrote: /home/fedora/rpmbuild/RPMS/x86_64/mysql-debuginfo-5.5.16-3.fc15.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.I5L4qW
+ umask 022
+ cd /home/fedora/rpmbuild/BUILD
+ cd mysql-5.5.16
+ rm -rf /home/fedora/rpmbuild/BUILDROOT/mysql-5.5.16-3.fc15.x86_64
+ exit 0


12.5 Install the RPM Files happily


[root@nareshv-build64 SOURCES]# yum install /home/fedora/rpmbuild/RPMS/x86_64/mysql-libs-5.5.16-3.fc15.x86_64.rpm \
/home/fedora/rpmbuild/RPMS/x86_64/mysql-5.5.16-3.fc15.x86_64.rpm \
/home/fedora/rpmbuild/RPMS/x86_64/mysql-devel-5.5.16-3.fc15.x86_64.rpm -y --nogpg


13. Now build hiphop again

[root@nareshv-build64 hiphop-php]# cd $HOME/dev/hiphop/hiphop-php/
[root@nareshv-build64 hiphop-php]# gmake clean
[root@nareshv-build64 hiphop-php]# cmake .
[root@nareshv-build64 hiphop-php]# make


14. You should have the binary created

[root@nareshv-build64 hiphop-php]# src/hphp/hphp -h | head
Error in command line: unknown option -h\n\n
HipHop Compiler for PHP Usage:

 hphp  

Options:
  --help                         display this message
  --version                      display version number
  -t [ --target ] arg (=run)     lint | analyze | php | cpp | sep-ext-cpp | 
                                 filecache | run (default)
  -f [ --format ] arg            lint: (none); 


15. Now continue with the rest of the tutorial on how to get your code compiled in the main hiphop project page itself.

Wednesday, June 29, 2011

Node.js on Fedora 15

Since currently there is no easy way to install node.js via yum repository. Here is how you can quickly get the node.js installed on your fedora-15 box

1. Install fedora packager rpms (as root)



[nareshv@localhost SRPMS]$ sudo yum groupinstall "Fedora Packager"



2. Create the setup environment for building RPM (for non-root users)



[nareshv@localhost ~]$ rpmdev-setuptree



3. Download the SRPM (as nonroot)



[nareshv@localhost ~]$ cd rpmbuild/SRPMS/
[nareshv@localhost SRPMS]$ ls
[nareshv@localhost SRPMS]$ wget http://v3.sk/~lkundrak/SRPMS/nodejs-0.4.1-1.el6.src.rpm
--2011-06-29 22:18:50-- http://v3.sk/~lkundrak/SRPMS/nodejs-0.4.1-1.el6.src.rpm
Resolving v3.sk... 91.210.183.14
Connecting to v3.sk|91.210.183.14|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4859437 (4.6M) [application/x-rpm]
Saving to: ânodejs-0.4.1-1.el6.src.rpmâ

100%[====================================================>] 4,859,437 600K/s in 11s

2011-06-29 22:19:03 (444 KB/s) - nodejs-0.4.1-1.el6.src.rpm



4. Install the dependencies for the RPM (as root)



[nareshv@localhost SRPMS]$ sudo yum install openssl-devel v8-devel c-ares-devel \
libev-devel libeio-devel http-parser-devel \
waf libgpg-error-devel \
libstdc++-devel gcc-c++ -y




5. Build the RPM (as non-root)



[nareshv@localhost SRPMS]$ rpmbuild --rebuild nodejs-0.4.1-1.el6.src.rpm
...
...
...
Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.OWCyPT
+ umask 022
+ cd /home/nareshv/rpmbuild/BUILD
+ cd node-v0.4.1
+ DOCDIR=/home/nareshv/rpmbuild/BUILDROOT/nodejs-0.4.1-1.el6.x86_64/usr/share/doc/nodejs-0.4.1
+ export DOCDIR
+ rm -rf /home/nareshv/rpmbuild/BUILDROOT/nodejs-0.4.1-1.el6.x86_64/usr/share/doc/nodejs-0.4.1
+ /bin/mkdir -p /home/nareshv/rpmbuild/BUILDROOT/nodejs-0.4.1-1.el6.x86_64/usr/share/doc/nodejs-0.4.1
+ cp -pr ChangeLog LICENSE README.md doc /home/nareshv/rpmbuild/BUILDROOT/nodejs-0.4.1-1.el6.x86_64/usr/share/doc/nodejs-0.4.1
+ exit 0
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: http_parser.so.0()(64bit) libc.so.6()(64bit) libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libc.so.6(GLIBC_2.4)(64bit) libcares.so.2()(64bit) libcrypto.so.10()(64bit) libdl.so.2()(64bit) libdl.so.2(GLIBC_2.2.5)(64bit) libeio.so.1()(64bit) libev.so.4()(64bit) libgcc_s.so.1()(64bit) libgcc_s.so.1(GCC_3.0)(64bit) libm.so.6()(64bit) libpthread.so.0()(64bit) libpthread.so.0(GLIBC_2.2.5)(64bit) librt.so.1()(64bit) libssl.so.10()(64bit) libstdc++.so.6()(64bit) libstdc++.so.6(CXXABI_1.3)(64bit) libstdc++.so.6(GLIBCXX_3.4)(64bit) libutil.so.1()(64bit) libutil.so.1(GLIBC_2.2.5)(64bit) libv8-3.0.0.1.so()(64bit) libz.so.1()(64bit) rtld(GNU_HASH)
Processing files: nodejs-devel-0.4.1-1.fc15.x86_64
Provides: pkgconfig(nodejs) = 0.3.2
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: /usr/bin/pkg-config
Processing files: nodejs-debuginfo-0.4.1-1.fc15.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/nareshv/rpmbuild/BUILDROOT/nodejs-0.4.1-1.el6.x86_64
Wrote: /home/nareshv/rpmbuild/RPMS/x86_64/nodejs-0.4.1-1.fc15.x86_64.rpm
Wrote: /home/nareshv/rpmbuild/RPMS/x86_64/nodejs-devel-0.4.1-1.fc15.x86_64.rpm
Wrote: /home/nareshv/rpmbuild/RPMS/x86_64/nodejs-debuginfo-0.4.1-1.fc15.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.ume4Ra
+ umask 022
+ cd /home/nareshv/rpmbuild/BUILD
+ cd node-v0.4.1
+ rm -rf /home/nareshv/rpmbuild/BUILDROOT/nodejs-0.4.1-1.el6.x86_64
+ exit 0
Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.goIXqg
+ umask 022
+ cd /home/nareshv/rpmbuild/BUILD
+ rm -rf node-v0.4.1
+ exit 0



6. Install the RPM (as root)



[nareshv@localhost SRPMS]$ sudo yum install /home/nareshv/rpmbuild/RPMS/x86_64/nodejs-0.4.1-1.fc15.x86_64.rpm --nogpg -y




7. Start node.js



[nareshv@localhost ~]$ node
> console.log("hello world!")
hello world!
>



Thats it!. Now you have node.js installed on your box.

Have a look at list of plugins and start playing with them.

Monday, June 06, 2011

Smashing Book 2



I really love the new Smashing Book 2.

I have placed the order, the moment they released it to everyone. Somehow for the first two times i never got the book. Third time i got the book and here is it.

I really really thank the Smashing Team for their efforts. Kudos to you guys n gals !

Thursday, September 30, 2010

Running Apache Traffic Server on Fedora 13

Apache Traffic server from Yahoo! Inc. is really powerful, extensible web server which is proved to serve 75K reqs/sec on commodity hardware.

In this post, you'll learn how to download and run the Traffic server on your desktop, notebook.


1. Download TrafficServer 2.0.1 (latest as of 30-Sep-2010)

http://trafficserver.apache.org/downloads.html

2. Install the following packages



[nareshv@fallenangel ~]$ sudo yum install autoconf automake \
libtool gcc-c++ glibc-devel \
openssl-devel tcl-devel \
expat-devel sqlite-devel \
pcre-devel -y



3. Extract the trafficserver and build it



[nareshv@fallenangel ~]$ tar jxf trafficserver-2.0.1.tar.bz2
[nareshv@fallenangel ~]$ cd trafficserver-2.0.1
[nareshv@fallenangel trafficserver-2.0.1]$ ./configure
[nareshv@fallenangel trafficserver-2.0.1]$ gmake
[nareshv@fallenangel trafficserver-2.0.1]$ sudo gmake install



Now, all the required files would be installed in "/usr/local" instead of Fedora's default /usr. Lets configure Traffic server to act as ReverseProxy for apache

5. set servername of your proxy (so that it will come up in the HTTP headers)



[nareshv@fallenangel ~]$ sudo vim /usr/local/etc/trafficserver/records.config

# Change line 22 (it might vary) to put your hostname like shown below
22 #CONFIG proxy.config.proxy_name STRING <proxy_name>
22 CONFIG proxy.config.proxy_name STRING fallenangel




6. Make the Traffic server listen on port 80 by default



[nareshv@fallenangel ~]$ sudo vim /usr/local/etc/trafficserver/records.config

# Change 8080 port to 80 like shown below
105 #CONFIG proxy.config.http.server_port INT 8080
105 CONFIG proxy.config.http.server_port INT 80



7. Make Traffic server act as reverse proxy for apache

You can add as many rules as you want. The configuration file is well defined


[nareshv@fallenangel ~]$ sudo vim /usr/local/etc/trafficserver/remap.config

124
125 map http://localhost:80/ http://localhost:8080/
126 map http://fallenangel:80/ http://localhost:8080/




8. configure apache to listen on port 8080



[nareshv@fallenangel ~]$ sudo vim /etc/httpd/conf/httpd.conf
# Change it from default port 80 to 8080
#Listen 80
Listen 8080



9. Restart apache



[nareshv@fallenangel ~]$ sudo /etc/init.d/httpd restart



10. Restart traffic server



[nareshv@fallenangel ~]$ sudo /usr/local/bin/trafficserver restart
Stopping traffic_cop: [ OK ]
Stopping traffic_manager: [ OK ]
Stopping traffic_server: [ OK ]
Starting Apache Traffic Server: [ OK ]



11. Make simple request to your TrafficServer to test if everything is ok



[nareshv@fallenangel ~]$ ~]$ curl -v http://localhost/
* About to connect() to localhost port 80 (#0)
* Trying ::1... Connection refused
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.20.1 (x86_64-redhat-linux-gnu) libcurl/7.20.1 NSS/3.12.6.2 zlib/1.2.3 libidn/1.16 libssh2/1.2.4
> Host: localhost
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Date: Thu, 30 Sep 2010 09:47:53 GMT
< Server: ATS/2.0.1
< Content-Type: text/html; charset=iso-8859-1
< Age: 0
< Transfer-Encoding: chunked
< Connection: keep-alive
< Via: HTTP/1.1 fallenangel (ApacheTrafficServer/2.0.1 [cMs f ])
<
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL / was not found on this server.</p>
<hr>
<address>Apache/2.2.16 (Fedora) Server at localhost Port 8080</address>
</body></html>
* Connection #0 to host localhost left intact
* Closing connection #0

Saturday, September 25, 2010

64-bit Flash Plugin on Fedora-13 running Firefox 4

Firefox 4 is around the corner, those who are running Fedora-13 and want to try out the latest 64-bit flash plugin. These are the instructions

1. Go to our mozilla plugins directory


[nareshv@fallenangel plugins]$ cd ~/.mozilla/plugins
[nareshv@fallenangel plugins]$ pwd
/home/nareshv/.mozilla/plugins



2. Download the latest flash plugin from the following url http://labs.adobe.com/downloads/flashplayer10.html and follow these steps

Latest download link is here.

[nareshv@fallenangel plugins]$ wget 'http://download.macromedia.com/pub/labs/flashplayer10/flashplayer_square_p1_64bit_linux_091510.tar.gz'
--2010-09-25 19:16:17-- http://download.macromedia.com/pub/labs/flashplayer10/flashplayer_square_p1_64bit_linux_091510.tar.gz
Resolving download.macromedia.com... 69.192.35.191
Connecting to download.macromedia.com|69.192.35.191|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4308402 (4.1M) [application/x-gzip]
Saving to: “flashplayer_square_p1_64bit_linux_091510.tar.gz”

100%[========================================================================================================================================>] 4,308,402 506K/s in 13s

2010-09-25 19:16:31 (332 KB/s) - “flashplayer_square_p1_64bit_linux_091510.tar.gz” saved [4308402/4308402]

[nareshv@fallenangel plugins]$ tar zxf flashplayer_square_p1_64bit_linux_091510.tar.gz
[nareshv@fallenangel plugins]$ ls
flashplayer_square_p1_64bit_linux_091510.tar.gz libflashplayer.so libflashplayer.so.old
[nareshv@fallenangel plugins]$ ls -l libflashplayer.so
-rw-rw-r--. 1 envy envy 10601968 Sep 4 04:47 libflashplayer.so



3. open http://www.youtube.com and see the flash player in action



4. Have fun with the new flash player.

Thursday, June 11, 2009

Fedora 11 64-bit Final on Macbook Pro 4,1

Installation Process



1. Touchpad



Touchpad doesn't work as usual during installation. Connect a USB mouse and things should be ok.

2. Install



Burn the DVD from http://fedoraproject.org and install OS as usual. If you need some help regarding the partitioning refer to this post

Post Install Process




1. BootDisk error



If you re-format all your partitions using Fedora-11 DVD during the installation, you might see this error "Invalid Boot Disk -- Insert boot disk and press any key to continue" error.

In order to fix this error, you need follow these steps


  1. Reboot your system
  2. Go to the 'refit' menu
  3. Choose the second icon from the left (Partitioning tool)
  4. If you see the 'refresh mbr', then do as requested
  5. Thats all! Now you should be able to boot correctly into Fedora


Shutdown your macbook and reboot. Now everything should work as usual




2. Wireless



You no longer need to install the ndiswrapper manually. Configure the 'livna' repository and install the ndiswrapper.


bash$ sudo yum install ndiswrapper


Download the drivers from here, and add them to the ndiswrapper


bash$ cd /tmp/drivers
bash$ sudo ndiswrapper -i *.inf
bash$ sudo ndiswrapper -m
bash$ sudo ndiswrapper -mi
bash$ sudo ndiswrapper -ml



3. Touchpad/Tapping



Fedora 11 Automatically configures the touchpad driver using the bcm5974 driver present in the 2.6.29 kernel.

But, not all the tapping/right-click,scrolling features are available. You need to create a new .fdi file with all the options to "synaptics" driver



nareshv@localhost $ cd /usr/share/hal/fdi/policy/20thirdparty
nareshv@localhost $ cp 10-synaptics.fdi 100-synaptics-custom.fdi



(Now edit 100-synaptics-custom.fdi, with the following contents)


nareshv@localhost $ cat 100-synaptics-custom.fdi
<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- DO NOT EDIT THIS FILE IN PLACE.
This file will be overwritten with the next update. If you need to add
custom options, copy the file into /etc/hal/fdi/policy/ first.

See https://fedoraproject.org/wiki/Input_device_configuration -->

<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="input.touchpad">
<!-- To add custom options for the touchpad, modify the examples below
to suit your needs. The available options are listed in the
"synaptics" man page. After modifyfing this file, you must
restart HAL. Check the output of lshal whether your modifications
have been merged successfully.

Note: <merge key="input.x11_options.s must always be type "string".
The following examples enable left, right, middle clicks on
single, double, triple finger tapping, respectively.

<merge key="input.x11_options.TapButton1" type="string">1</merge>
<merge key="input.x11_options.TapButton2" type="string">3</merge>
<merge key="input.x11_options.TapButton3" type="string">2</merge>
-->
<merge key="input.x11_driver" type="string">synaptics</merge>
<merge key="input.x11_options.LeftEdge" type="string">10</merge>
<merge key="input.x11_options.RightEdge" type="string">1200</merge>
<merge key="input.x11_options.TopEdge" type="string">10</merge>
<merge key="input.x11_options.BottomEdge" type="string">370</merge>
<merge key="input.x11_options.FingerLow" type="string">10</merge>
<merge key="input.x11_options.FingerHigh" type="string">20</merge>
<merge key="input.x11_options.MaxTapTime" type="string">180</merge>
<merge key="input.x11_options.MaxTapMove" type="string">220</merge>
<merge key="input.x11_options.SingleTapTimeout" type="string">100</merge>
<merge key="input.x11_options.MaxDoubleTapTime" type="string">180</merge>
<merge key="input.x11_options.LockedDrags" type="string">off</merge>
<merge key="input.x11_options.MinSpeed" type="string">1.10</merge>
<merge key="input.x11_options.MaxSpeed" type="string">1.30</merge>
<merge key="input.x11_options.AccelFactor" type="string">0.08</merge>
<merge key="input.x11_options.TapButton1" type="string">1</merge>
<merge key="input.x11_options.TapButton2" type="string">3</merge>
<merge key="input.x11_options.TapButton3" type="string">2</merge>
<merge key="input.x11_options.ClickFinger1" type="string">1</merge>
<merge key="input.x11_options.ClickFinger2" type="string">3</merge>
<merge key="input.x11_options.ClickFinger3" type="string">2</merge>
<merge key="input.x11_options.RTCornerButton" type="string">0</merge>
<merge key="input.x11_options.RBCornerButton" type="string">0</merge>
<merge key="input.x11_options.LTCornerButton" type="string">0</merge>
<merge key="input.x11_options.LBCornerButton" type="string">0</merge>
<merge key="input.x11_options.VertScrollDelta" type="string">20</merge>
<merge key="input.x11_options.HorizScrollDelta" type="string">50</merge>
<merge key="input.x11_options.HorizEdgeScroll" type="string">0</merge>
<merge key="input.x11_options.VertEdgeScroll" type="string">0</merge>
<merge key="input.x11_options.VertTwoFingerScroll" type="string">1</merge>
<merge key="input.x11_options.HorizTwoFingerScroll" type="string">1</merge>
</match>
</device>
</deviceinfo>


NOTE: If you want to adjust the tapping, speed of mouse scroll, do these things



nareshv@localhost $ sudo yum install gsynaptics



Make your changes. and run the following command to see the latest changes. Now use the below keywords and update the above .fdi file.



nareshv@localhost $ synclient -l
Parameter settings:
LeftEdge = 10
RightEdge = 1200
TopEdge = 10
BottomEdge = 370
FingerLow = 10
FingerHigh = 20
FingerPress = 256
MaxTapTime = 180
MaxTapMove = 220
MaxDoubleTapTime = 180
SingleTapTimeout = 100
ClickTime = 100
FastTaps = 0
EmulateMidButtonTime = 75
EmulateTwoFingerMinZ = 282
EmulateTwoFingerMinW = 7
VertScrollDelta = 20
HorizScrollDelta = 50
VertEdgeScroll = 0
HorizEdgeScroll = 0
CornerCoasting = 0
VertTwoFingerScroll = 1
HorizTwoFingerScroll = 0
MinSpeed = 1.1
MaxSpeed = 0
AccelFactor = 1.3
TrackstickSpeed = 0
EdgeMotionMinZ = 30
EdgeMotionMaxZ = 160
EdgeMotionMinSpeed = 1
EdgeMotionMaxSpeed = 120
EdgeMotionUseAlways = 0
UpDownScrolling = 1
LeftRightScrolling = 1
UpDownScrollRepeat = 1
LeftRightScrollRepeat = 1
ScrollButtonRepeat = 100
TouchpadOff = 0
GuestMouseOff = 0
LockedDrags = 0
LockedDragTimeout = 5000
RTCornerButton = 0
RBCornerButton = 0
LTCornerButton = 0
LBCornerButton = 0
TapButton1 = 0
TapButton2 = 0
TapButton3 = 0
ClickFinger1 = 1
ClickFinger2 = 3
ClickFinger3 = 2
CircularScrolling = 0
CircScrollDelta = 0.1
CircScrollTrigger = 0
CircularPad = 0
PalmDetect = 0
PalmMinWidth = 10
PalmMinZ = 200
CoastingSpeed = 0
PressureMotionMinZ = 30
PressureMotionMaxZ = 160
PressureMotionMinFactor = 1
PressureMotionMaxFactor = 0
GrabEventDevice = 1




4. Audio



Somehow the audio doesn't work out of the box, you need to set the model option


bash$ echo "options snd_hda_intel model=mbp3" >> /etc/modprobe.d/sound


5. Bluetooth



Works out of the box

6. Firewire



Haven't tested (Don't have a device to check)

7. Microphone



Haven't tested

8. Network Card



Works out of the box

9. Nvidia Graphics card



Works out of the box, using "nouveau" driver.

10. Keyboard special keys / Backlight



works out of the box.


11. isight (webcam)



Works out of the box.

12. Sensors



Works out of the box.


nareshv@localhost $ sensors
applesmc-isa-0300
Adapter: ISA adapter
Left side :1996 RPM (min = 2000 RPM)
Right side :1999 RPM (min = 2000 RPM)
temp1: +32.2°C
temp2: +43.2°C
temp3: +42.0°C
temp4: +52.5°C
temp5: +43.0°C
temp6: +70.0°C
temp7: +51.5°C
temp8: +42.8°C
temp9: +36.8°C
temp10: +37.0°C
temp11: +37.8°C
temp12: +34.0°C


14. Suspend , Resume



Fedora 11 still has this suspend resume bug. Upon resume we will get this error from dmesg and the mouse will be stuck


nareshv@ localhost $ | dmesg | tail -1
bcm5974: bad trackpad package, length: 8


Fix is as described in my earlier post.



(If you are running 32-bit Fedora 11 use /usr/lib instead of /usr/lib64)


nareshv@nareshv «sr/lib64/pm-utils/sleep.d $ ls -l
total 64
-rwxr-xr-x. 1 root root 2490 2009-04-24 15:21 00auto-quirk*
-rwxr-xr-x. 1 root root 274 2009-04-24 15:21 00logging*
-rwxr-xr-x. 1 root root 203 2009-04-24 15:21 00powersave*
-rwxr-xr-x. 1 root root 809 2009-04-24 15:21 01grub*
-rwxr-xr-x. 1 root root 664 2009-04-24 15:21 49bluetooth*
-rwxr-xr-x. 1 root root 991 2009-04-24 15:21 55NetworkManager*
-rwxr-xr-x. 1 root root 141 2009-02-26 19:25 56atd*
-rwxr-xr-x. 1 root root 335 2009-04-24 15:21 75modules*
-rwxr-xr-x. 1 root root 455 2009-04-24 15:21 90clock*
-rwxr-xr-x. 1 root root 1098 2009-04-24 15:21 94cpufreq*
-rwxr-xr-x. 1 root root 297 2009-04-24 15:21 95led*
-rwxr-xr-x. 1 root root 707 2009-04-24 14:57 95packagekit*
-rwxr-xr-x. 1 root root 2269 2009-04-24 15:21 98smart-kernel-video*
-rwxr-xr-x. 1 root root 2068 2009-04-24 15:21 99hd-apm-restore.hook*
-rwxr-xr-x. 1 root root 5685 2009-04-24 15:21 99video*

[nareshv@nareshv ~]$ cat /usr/lib64/pm-utils/sleep.d/02touchpad
#!/bin/bash

if [ -e '/usr/lib64/pm-utils/functions' ];then
. /usr/lib64/pm-utils/functions
fi

suspend_bcm5974() { /sbin/rmmod bcm5974; }
resume_bcm5974() { /sbin/modprobe bcm5974; }

case "$1" in
suspend|hibernate)
suspend_bcm5974;
;;
thaw|resume)
resume_bcm5974;
;;
*)
;;
esac

exit $?