tag:blogger.com,1999:blog-181258902024-03-14T05:21:37.994+05:30NareshBlog of Naresh Kumar (nareshv)Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.comBlogger40125tag:blogger.com,1999:blog-18125890.post-20581572165258607792014-04-14T10:38:00.002+05:302014-04-14T10:44:48.417+05:30Installing HHVM 3.0.1 on Centos 6.5 (64-bit)<div dir="ltr" style="text-align: left;" trbidi="on">
3.0.0 is the latest series in the HHVM world. In order to upgrade/install the 3.0.1 package. Follow these instructions<br />
<br />
Compared to 2.4 HHVM release, the following packages were upgraded from the stock centos repository. Please be aware of these.<br />
<br />
<ol style="text-align: left;">
<li>ocaml (from 3.11 to 3.12)</li>
<li>ImageMagick (from 6.5 to 6.8)</li>
</ol>
<br />
If you are here for the first time, configure hop5.in repo like this<br />
<br />
<br />
<pre>cd /etc/yum.repos.d
sudo wget http://www.hop5.in/yum/el6/hop5.repo </pre>
After that do a simple<br />
<br />
<pre>[root@node1 ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base elrepo epel extras hop5 mod-pagespeed nginx nikoforge pgdg92 rpmforge rpmforge-extras
: rpmfusion-free-updates rpmfusion-nonfree-updates updates
Cleaning up Everything
Cleaning up list of fastest mirrors
</pre>
<pre>[root@node1 ~]# yum install hhvm
Loaded plugins: fastestmirror
Determining fastest mirrors
epel/metalink | 14 kB 00:00
* base: mirrors.advancedhosters.com
* elrepo: ftp.nluug.nl
* epel: epel.mirror.constant.com
* extras: mirrors.lga7.us.voxel.net
* rpmforge: mirror.nl.leaseweb.net
* rpmforge-extras: mirror.nl.leaseweb.net
* rpmfusion-free-updates: mirror.us.leaseweb.net
* rpmfusion-nonfree-updates: mirror.us.leaseweb.net
* updates: mirror.lug.udel.edu
base | 3.7 kB 00:00
base/primary_db | 4.4 MB 00:01
elrepo | 2.9 kB 00:00
elrepo/primary_db | 625 kB 00:00
epel | 4.4 kB 00:00
epel/primary_db | 6.0 MB 00:01
extras | 3.4 kB 00:00
extras/primary_db | 19 kB 00:00
hop5 | 2.9 kB 00:00
hop5/primary_db | 153 kB 00:00
mod-pagespeed | 951 B 00:00
mod-pagespeed/primary | 5.1 kB 00:00
mod-pagespeed 32/32
nginx | 2.9 kB 00:00
nginx/primary_db | 28 kB 00:00
nikoforge | 1.3 kB 00:00
nikoforge/primary | 3.8 kB 00:00
nikoforge 8/8
pgdg92 | 3.7 kB 00:00
pgdg92/primary_db | 102 kB 00:00
rpmforge | 1.9 kB 00:00
rpmforge/primary_db | 2.7 MB 00:00
rpmforge-extras | 1.9 kB 00:00
rpmforge-extras/primary_db | 471 kB 00:00
rpmfusion-free-updates | 2.7 kB 00:00
rpmfusion-free-updates/primary_db | 267 kB 00:00
rpmfusion-nonfree-updates | 2.2 kB 00:00
rpmfusion-nonfree-updates/primary_db | 65 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 2.6 MB 00:01
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package hhvm.x86_64 0:2.4.0-1.el6 will be updated
---> Package hhvm.x86_64 0:3.0.1-1.el6 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================
Updating:
hhvm x86_64 3.0.1-1.el6 hop5 9.4 M
Transaction Summary
===============================================================================================================================
Upgrade 1 Package(s)
Total download size: 9.4 M
Is this ok [y/N]: y
Downloading Packages:
hhvm-3.0.1-1.el6.x86_64.rpm | 9.4 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : hhvm-3.0.1-1.el6.x86_64 1/2
Cleanup : hhvm-2.4.0-1.el6.x86_64 2/2
Verifying : hhvm-3.0.1-1.el6.x86_64 1/2
Verifying : hhvm-2.4.0-1.el6.x86_64 2/2
Updated:
hhvm.x86_64 0:3.0.1-1.el6
Complete!
[root@node1 ~]# </pre>
If you are upgrading from previous <b>hiphop-php</b> Package, Just do a
<br />
<pre>[root@node1 ~]# yum update hiphop-php
</pre>
After this, check that hhvm is installed correctly<br />
<br />
<pre>[root@node1 ~]# hhvm --version
HipHop VM 3.0.1 (rel)
Compiler:
Repo schema: e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
</pre>
Have fun with this new and improved release.<br />
<br />
<br /></div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com19tag:blogger.com,1999:blog-18125890.post-72965431826466007482014-03-18T18:25:00.001+05:302014-03-18T18:27:44.670+05:30AtomSQL - Simple Database Query Language for RDBMS & NoSQL Systems<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://nareshv.github.io/atomsql/">AtomSQL</a> came from the frustration of working too much with RDBMS systems and typing too much to get the necessary data from the Databases.<br />
<br />
This post is an introduction to <a href="http://nareshv.github.io/atomsql/">AtomSQL</a><br />
<br />
Lets go through the following examples to see how we use SQL queries normally and in AtomSQL Format.<br />
<br />
1. Create a new table<br />
<br />
BEFORE:<br />
<pre>CREATE TABLE myTable (id INTEGER PRIMARYKEY, name VARCHAR(255) ENGINE=INNODB
</pre>
<br />
AFTER:<br />
<br />
<pre>myTable { id INTEGER PRIMARY KEY, name VARCHAR(255) } ENGINE=INNODB
</pre>
<br />
So, what has changed ???<br />
<br />
We just got rid of the keywords and are letting the {} do the necessary JOB.<br />
<br />
<i>TIP: Remember C/C++ Structures ? </i><br />
<br />
2. Inserting new records to the table<br />
<br />
Before:<br />
<br />
<pre>INSERT INTO myTable VALUES (1, 'Tom'), (2, 'Jerry')
</pre>
<br />
After:<br />
<br />
<pre>myTable = [ (1, 'Tom'), (2, 'Jerry') ]
</pre>
<br />
Again, We use () for Tuples and [] for Array representation to get the job done. Keywords have gone away !<br />
<i>TIP: Remember JSON, Perl Arrays ? </i><br />
<br />
3. Updating records<br />
<br />
Before<br />
<br />
<pre>UPDATE myTable SET name = 'Jerry Mouse' Where name = 'Jerry'
</pre>
<br />
After<br />
<br />
<pre>myTable /name = 'Jerry Mouse'/ (name = 'Jerry')
</pre>
<br />
Again, we are using // for replacing data and () are used for condition to be used in WHERE Clause<br />
<i>TIP: Remember perl, sed, vim for data replacement ? </i><br />
<br />
4. Deleting records<br />
<br />
Before<br />
<br />
<pre>DELETE FROM myTable Where name = 'Jerry'
</pre>
<br />
After<br />
<br />
<pre>! myTable (name = 'Jerry')
</pre>
<br />
! Bang is the operator for destroying stuff.
() is used for WHERE Clause<br />
<br />
5. Seleting Records<br />
<br />
Before<br />
<br />
<pre>SELECT * from myTable where name != 'Jerry'
</pre>
<br />
After<br />
<br />
<pre>myTable <*> (name != 'Jerry')
</pre>
<br />
<> is used for Column selection and () is used for WHERE clause<br />
<br />
More Features/Limitations/Installation can be read from <a href="http://nareshv.github.io/atomsql/">http://nareshv.github.io/atomsql/</a></div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com0tag:blogger.com,1999:blog-18125890.post-59452961234228739392014-02-11T18:03:00.001+05:302014-02-12T17:12:51.425+05:30Configure HHVM with Apache + FastCGI on Centos 6.5<div dir="ltr" style="text-align: left;" trbidi="on">
On centos you can run regular fastcgi processes with <b>mod_fcgid</b> package. In order to communicate with <b>HHVM</b> over TCP/IP you need to install <b>mod_fastcgi</b> which is available elsewhere on the internet.<br />
<br />
Follow these instructions to use apache + fastcgi with hhvm.<br />
<br />
0. Pre-requisites<br />
<br />
Make sure you add the following to /etc/hosts on your server where you are going to use curl/browser<br />
<br />
<span style="color: red;">127.0.0.1 test.example.com </span><br />
<br />
1. Install httpd-devel packages<br />
<br />
<pre>[root@localhost yum.repos.d]# yum install httpd-devel -y
</pre>
<br />
2. Download mod_fastcgi<br />
<br />
<pre> [root@localhost ~]# wget http://www.fastcgi.com/dist/mod_fastcgi-SNAP-0910052141.tar.gz
</pre>
<br />
3. Compile and install mod_fastcgi<br />
<br />
Make sure to change the top_dir variable in the Makefile to centos specific like below or else package wont compile<br />
<br />
<span style="color: red;"><i>top_dir = /usr/lib64/httpd</i></span><br />
<br />
<pre>[root@localhost ~]# tar zxf mod_fastcgi-SNAP-0910052141.tar.gz
[root@localhost ~]# cd mod_fastcgi-SNAP-0910052141
[root@localhost mod_fastcgi-SNAP-0910052141]# cp Makefile.AP2 Makefile
[root@localhost mod_fastcgi-SNAP-0910052141]# make
[root@localhost mod_fastcgi-SNAP-0910052141]# make install
</pre>
4. Start the hhvm server in fastcgi mode<br />
<br />
<pre>[root@localhost ~]# /usr/bin/hhvm --mode server -vServer.Port=9000 -vServer.Type=fastcgi
mapping self...
mapping self took 0'00" (34658 us) wall time
loading static content...
loading static content took 0'00" (3 us) wall time
page server started
all servers started
</pre>
5. Create a dummy apache configuration file<br />
<br />
<pre>[root@localhost ~]# cat /etc/httpd/conf.d/1.conf
<virtualhost>
ServerName test.example.com
DocumentRoot /var/www/localhost
LoadModule fastcgi_module modules/mod_fastcgi.so
FastCgiExternalServer /var/www/localhost -host 127.0.0.1:9000
</virtualhost>
[root@localhost ~]#
</pre>
<br />
6. Create document root and simple php file<br />
<br />
<pre>mkdir -p /var/www/localhost && echo '<?php echo "hello world"; ?>' > /var/www/localhost/index.php
</pre>
<br />
7. Start httpd from another terminal<br />
<br />
<pre>[root@localhost ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
[ OK ]
</pre>
8. Fire a request and see that you get response from HHVM
<br />
<pre> nareshv @ localhost $ curl http://test.example.com/index.php ; echo
hello world!
nareshv @ localhost $
nareshv @ localhost $ curl http://test.example.com/404.php ; echo
Not Found
nareshv @ localhost $
</pre>
9. Final configurations<br />
<br />
Once you have proper working setup like above, create a configuration file for hhvm and run it in daemon mode.<br />
<br />
Have Fun!</div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com2tag:blogger.com,1999:blog-18125890.post-75212141618835526232014-02-10T14:31:00.000+05:302014-02-10T14:31:07.628+05:30Installing docker 0.8 version on Centos 6.5<div dir="ltr" style="text-align: left;" trbidi="on">
1. Configure EPEL Repository
<br />
<pre>[root@localhost ~]# sudo yum install http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: centos.aol.in
* extras: centos.aol.in
* updates: centos.aol.in
Setting up Install Process
epel-release-6-8.noarch.rpm | 14 kB 00:00
Examining /var/tmp/yum-root-7UK58w/epel-release-6-8.noarch.rpm: epel-release-6-8.noarch
Marking /var/tmp/yum-root-7UK58w/epel-release-6-8.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:6-8 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================
Package Arch Version Repository Size
======================================================================================================================
Installing:
epel-release noarch 6-8 /epel-release-6-8.noarch 22 k
Transaction Summary
======================================================================================================================
Install 1 Package(s)
Total size: 22 k
Installed size: 22 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : epel-release-6-8.noarch 1/1
Verifying : epel-release-6-8.noarch 1/1
Installed:
epel-release.noarch 0:6-8
Complete!
</pre>
2. Install the docker-io package from EPEL Repository
<br />
<pre>[root@localhost ~]# yum install docker-io
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/metalink | 4.6 kB 00:00
* base: centos.aol.in
* epel: epel.mirror.net.in
* extras: centos.aol.in
* updates: centos.aol.in
epel | 4.2 kB 00:00
epel/primary_db | 5.9 MB 00:06
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package docker-io.x86_64 0:0.7.6-2.el6 will be installed
--> Processing Dependency: xz for package: docker-io-0.7.6-2.el6.x86_64
--> Processing Dependency: lxc for package: docker-io-0.7.6-2.el6.x86_64
--> Processing Dependency: libcgroup for package: docker-io-0.7.6-2.el6.x86_64
--> Running transaction check
---> Package libcgroup.x86_64 0:0.40.rc1-5.el6_5.1 will be installed
---> Package lxc.x86_64 0:0.9.0-2.el6 will be installed
--> Processing Dependency: liblxc.so.0()(64bit) for package: lxc-0.9.0-2.el6.x86_64
---> Package xz.x86_64 0:4.999.9-0.3.beta.20091007git.el6 will be installed
--> Running transaction check
---> Package lxc-libs.x86_64 0:0.9.0-2.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================
Package Arch Version Repository Size
======================================================================================================================
Installing:
docker-io x86_64 0.7.6-2.el6 epel 3.4 M
Installing for dependencies:
libcgroup x86_64 0.40.rc1-5.el6_5.1 updates 125 k
lxc x86_64 0.9.0-2.el6 epel 78 k
lxc-libs x86_64 0.9.0-2.el6 epel 116 k
xz x86_64 4.999.9-0.3.beta.20091007git.el6 base 137 k
Transaction Summary
======================================================================================================================
Install 5 Package(s)
Total download size: 3.9 M
Installed size: 19 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): docker-io-0.7.6-2.el6.x86_64.rpm | 3.4 MB 00:03
(2/5): libcgroup-0.40.rc1-5.el6_5.1.x86_64.rpm | 125 kB 00:00
(3/5): lxc-0.9.0-2.el6.x86_64.rpm | 78 kB 00:00
(4/5): lxc-libs-0.9.0-2.el6.x86_64.rpm | 116 kB 00:00
(5/5): xz-4.999.9-0.3.beta.20091007git.el6.x86_64.rpm | 137 kB 00:00
----------------------------------------------------------------------------------------------------------------------
Total 858 kB/s | 3.9 MB 00:04
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
Userid : EPEL (6) <epel fedoraproject.org="">
Package: epel-release-6-8.noarch (@/epel-release-6-8.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Is this ok [y/N]: y
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key centos.org="">
Package: centos-release-6-5.el6.centos.11.1.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libcgroup-0.40.rc1-5.el6_5.1.x86_64 1/5
Installing : xz-4.999.9-0.3.beta.20091007git.el6.x86_64 2/5
Installing : lxc-libs-0.9.0-2.el6.x86_64 3/5
Installing : lxc-0.9.0-2.el6.x86_64 4/5
Installing : docker-io-0.7.6-2.el6.x86_64 5/5
Verifying : lxc-libs-0.9.0-2.el6.x86_64 1/5
Verifying : xz-4.999.9-0.3.beta.20091007git.el6.x86_64 2/5
Verifying : docker-io-0.7.6-2.el6.x86_64 3/5
Verifying : libcgroup-0.40.rc1-5.el6_5.1.x86_64 4/5
Verifying : lxc-0.9.0-2.el6.x86_64 5/5
Installed:
docker-io.x86_64 0:0.7.6-2.el6
Dependency Installed:
libcgroup.x86_64 0:0.40.rc1-5.el6_5.1 lxc.x86_64 0:0.9.0-2.el6 lxc-libs.x86_64 0:0.9.0-2.el6
xz.x86_64 0:4.999.9-0.3.beta.20091007git.el6
Complete!
[root@localhost ~]#
</centos-6-key></epel></pre>
3. For the brave, start the docker and see these warnings
<br />
<pre>[root@localhost ~]# docker -d &
[1] 1145
[root@localhost ~]# 2014/02/10 03:23:29 WARNING: You are running linux kernel version 2.6.32-431.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.8.0.
[/var/lib/docker|c3648251] +job initapi()
[/var/lib/docker|c3648251.initapi()] Creating server
</pre>
Docker will continue to run. But, better upgrade to kernel 3.8 or higher.
4. Configure the elrepo repository so that we can upgrade kernel to 3.8 or higher
<br />
<pre>[root@localhost ~]# yum install http://www.elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.aol.in
* epel: epel.mirror.net.in
* extras: centos.aol.in
* updates: centos.aol.in
Setting up Install Process
elrepo-release-6-5.el6.elrepo.noarch.rpm | 7.2 kB 00:00
Examining /var/tmp/yum-root-7UK58w/elrepo-release-6-5.el6.elrepo.noarch.rpm: elrepo-release-6-5.el6.elrepo.noarch
Marking /var/tmp/yum-root-7UK58w/elrepo-release-6-5.el6.elrepo.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package elrepo-release.noarch 0:6-5.el6.elrepo will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================
Package Arch Version Repository Size
======================================================================================================================
Installing:
elrepo-release noarch 6-5.el6.elrepo /elrepo-release-6-5.el6.elrepo.noarch 2.8 k
Transaction Summary
======================================================================================================================
Install 1 Package(s)
Total size: 2.8 k
Installed size: 2.8 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : elrepo-release-6-5.el6.elrepo.noarch 1/1
Verifying : elrepo-release-6-5.el6.elrepo.noarch 1/1
Installed:
elrepo-release.noarch 0:6-5.el6.elrepo
Complete!
</pre>
5. Install the kernel-ml from elrepo
<br />
<pre>[root@localhost ~]# yum --enablerepo=elrepo-kernel install kernel-ml
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.aol.in
* elrepo: mirror.smartmedia.net.id
* elrepo-kernel: mirror.smartmedia.net.id
* epel: epel.mirror.net.in
* extras: centos.aol.in
* updates: centos.aol.in
elrepo | 2.9 kB 00:00
elrepo/primary_db | 593 kB 00:02
elrepo-kernel | 2.9 kB 00:00
elrepo-kernel/primary_db | 19 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package kernel-ml.x86_64 0:3.13.2-1.el6.elrepo will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================
Package Arch Version Repository Size
======================================================================================================================
Installing:
kernel-ml x86_64 3.13.2-1.el6.elrepo elrepo-kernel 35 M
Transaction Summary
======================================================================================================================
Install 1 Package(s)
Total download size: 35 M
Installed size: 159 M
Is this ok [y/N]: y
Downloading Packages:
kernel-ml-3.13.2-1.el6.elrepo.x86_64.rpm | 35 MB 02:21
warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID baadae52: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
Importing GPG key 0xBAADAE52:
Userid : elrepo.org (RPM Signing Key for elrepo.org) <secure elrepo.org="">
Package: elrepo-release-6-5.el6.elrepo.noarch (@/elrepo-release-6-5.el6.elrepo.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : kernel-ml-3.13.2-1.el6.elrepo.x86_64 1/1
Verifying : kernel-ml-3.13.2-1.el6.elrepo.x86_64 1/1
Installed:
kernel-ml.x86_64 0:3.13.2-1.el6.elrepo
Complete!
[root@localhost ~]#
</secure></pre>
6. Reboot the server into the 3.13 kernel (MAKE SURE TO SELECT KERNEL IN GRUB MENU)
<br />
<pre>[root@localhost ~]# reboot
Broadcast message from root@localhost.localdomain
(/dev/pts/0) at 3:33 ...
The system is going down for reboot NOW!
</pre>
7. Login and verify the server kernel version
<br />
<pre>
[root@localhost ~]# uname -r
3.13.2-1.el6.elrepo.x86_64
[root@localhost ~]#
</pre>
8. See that a new docker0 interface is created
<br />
<pre>[root@localhost ~]# ifconfig
docker0 Link encap:Ethernet HWaddr A2:FA:1E:55:53:77
inet addr:172.17.42.1 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::a0fa:1eff:fe55:5377/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:1422 (1.3 KiB)
eth0 Link encap:Ethernet HWaddr 08:00:27:D5:BC:A0
inet addr:192.168.1.111 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fed5:bca0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:118 errors:0 dropped:0 overruns:0 frame:0
TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13818 (13.4 KiB) TX bytes:7215 (7.0 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[root@localhost ~]#
</pre>
9. Start the docker in daemon mode
<br />
<pre>[root@localhost ~]# docker -d
</pre>
10. Verify the docker version
<br />
<pre>[root@localhost ~]# docker version
Client version: 0.7.6
Go version (client): go1.2
Git commit (client): bc3b2ec/0.7.6
Server version: 0.7.6
Git commit (server): bc3b2ec/0.7.6
Go version (server): go1.2
Last stable version: 0.8.0, please update docker
[root@localhost ~]#
</pre>
11. Update to 0.8 version (Optional Step)
<br />
<pre>[root@localhost ~]# ps auxww | grep docker
root 1008 0.0 1.3 338992 6788 ? Sl 03:35 0:00 /usr/bin/docker -d
root 1357 0.0 0.1 103296 820 pts/0 S+ 03:55 0:00 grep docker
[root@localhost ~]# kill -9 1008
</pre>
<pre>[root@localhost ~]# yum install http://kojipkgs.fedoraproject.org//packages/docker-io/0.8.0/2.el6/x86_64/docker-io-0.8.0-2.el6.x86_64.rpm
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.aol.in
* elrepo: mirror.smartmedia.net.id
* epel: epel.mirror.net.in
* extras: centos.aol.in
* updates: centos.aol.in
Setting up Install Process
docker-io-0.8.0-2.el6.x86_64.rpm | 3.6 MB 00:05
Examining /var/tmp/yum-root-7UK58w/docker-io-0.8.0-2.el6.x86_64.rpm: docker-io-0.8.0-2.el6.x86_64
Marking /var/tmp/yum-root-7UK58w/docker-io-0.8.0-2.el6.x86_64.rpm as an update to docker-io-0.7.6-2.el6.x86_64
Resolving Dependencies
--> Running transaction check
---> Package docker-io.x86_64 0:0.7.6-2.el6 will be updated
---> Package docker-io.x86_64 0:0.8.0-2.el6 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================
Package Arch Version Repository Size
======================================================================================================================
Updating:
docker-io x86_64 0.8.0-2.el6 /docker-io-0.8.0-2.el6.x86_64 19 M
Transaction Summary
======================================================================================================================
Upgrade 1 Package(s)
Total size: 19 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : docker-io-0.8.0-2.el6.x86_64 1/2
Cleanup : docker-io-0.7.6-2.el6.x86_64 2/2
Verifying : docker-io-0.8.0-2.el6.x86_64 1/2
Verifying : docker-io-0.7.6-2.el6.x86_64 2/2
Updated:
docker-io.x86_64 0:0.8.0-2.el6
Complete!
</pre>
<pre>[root@localhost ~]# docker info
Containers: 0
Images: 0
Driver: devicemapper
Pool Name: docker-253:0-110-pool
Data file: /var/lib/docker/devicemapper/devicemapper/data
Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata
Data Space Used: 291.5 Mb
Data Space Total: 102400.0 Mb
Metadata Space Used: 0.7 Mb
Metadata Space Total: 2048.0 Mb
WARNING: No swap limit support
[root@localhost ~]#
</pre>
<p>
Go to http://docs.docker.io/en/latest/ and get started with docker.
</p>
<p>
Have Fun !
</p>
<p>
NOTE: If you were use http://www.hop5.in repository. Dont worry as the package upgrades are seamless due to the package name being same.
</p>
</div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com9tag:blogger.com,1999:blog-18125890.post-7920921108965297702013-10-19T16:12:00.001+05:302013-10-19T16:13:14.598+05:30Install HHVM 2.2.0 Final Release on Centos 6.4 (64-bit)<div dir="ltr" style="text-align: left;" trbidi="on">
Facebook released <a href="http://www.hhvm.com/blog/1301/hhvm-2-2-0">HHVM 2.2.0</a> couple of days ago and made the package available on multiple distributions.<br />
<br />
Setup hop5.in repo as mentioned in <a href="http://nareshv.blogspot.in/2013/05/install-hhvm-hiphop-php-on-centos-64-64.html">this blog post</a><br />
<br />
1. Install the package using yum<br />
<br />
<pre>[root@node1 x86_64]# yum install hiphop-php-2.2.0-1.el6.x86_64 -y
</pre>
<br />
2. Check the version of newly installed package<br />
<br />
<pre>[root@node1 x86_64]# hhvm --version
HipHop VM v2.2.0 (rel)
Compiler: 1382176880_483521803
Repo schema: 484929643_1382176880</pre>
<br />
3. Have fun with this new release :-)<br />
<br />
Long list of <a href="http://www.hhvm.com/blog/1301/hhvm-2-2-0">changelog</a> is available here </div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com0tag:blogger.com,1999:blog-18125890.post-76812973511307093002013-09-19T18:25:00.001+05:302013-09-19T18:26:11.984+05:30Docker.io Version 0.7 to be available on Fedora/Redhat/Centos<div dir="ltr" style="text-align: left;" trbidi="on">
There seem to be lot of <a href="http://blog.docker.io/2013/09/red-hat-and-docker-collaborate/">effort</a> going on to make docker.io available on Redhat based systems.<br />
<br />
What it means is that, a simple yum install on stock Fedora, Redhat, Centos will give you the docker.io awesomeness.<br />
<br />
More details are available on this blog <a href="http://blog.docker.io/2013/09/red-hat-and-docker-collaborate/">post</a></div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com0tag:blogger.com,1999:blog-18125890.post-23690828531834067072013-09-10T19:02:00.000+05:302013-09-10T19:36:26.700+05:30Postgresql 9.3 and NoSQL Awesomeness on Fedora 19<div dir="ltr" style="text-align: left;" trbidi="on">
Postgresql 9.3 was <a href="http://www.postgresql.org/about/news/1481/">released yesterday</a>. This document explains how to install postgresql 9.3 on Fedora 19 system and play with the built-in JSON support for the columns. (i.e the NOSQL Feature within a RDBMS database!)<br />
<br />
1. Install Fedora 19 as you usually do<br />
<br />
2. Setup PGDG Repository<br />
<br />
<pre>[root@fallenangel ~]# yum install http://yum.postgresql.org/9.3/fedora/fedora-19-x86_64/pgdg-fedora93-9.3-1.noarch.rpm -y
oaded plugins: fastestmirror, langpacks, refresh-packagekit
pgdg-fedora93-9.3-1.noarch.rpm | 5.1 kB 00:00:00
Examining /var/tmp/yum-root-cjnqf8/pgdg-fedora93-9.3-1.noarch.rpm: pgdg-fedora93-9.3-1.noarch
Marking /var/tmp/yum-root-cjnqf8/pgdg-fedora93-9.3-1.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package pgdg-fedora93.noarch 0:9.3-1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
Total size: 2.1 k
Installed size: 2.1 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : pgdg-fedora93-9.3-1.noarch 1/1
Verifying : pgdg-fedora93-9.3-1.noarch 1/1
Installed:
pgdg-fedora93.noarch 0:9.3-1
Complete!
</pre>
3. Install postgresql-9.3
<br />
<pre>
[root@fallenangel ~]# yum install postgresql93-server -y
</pre>
<br />
4. Initialize the Postgresql database<br />
<br />
<pre>[root@fallenangel ~]# su - postgres
-bash-4.2$ env PGDATA=/var/lib/pgsql/9.3/data /usr/pgsql-9.3/bin/initdb
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/pgsql/9.3/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
creating configuration files ... ok
creating template1 database in /var/lib/pgsql/9.3/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating collations ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
syncing data to disk ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
/usr/pgsql-9.3/bin/postgres -D /var/lib/pgsql/9.3/data
or
/usr/pgsql-9.3/bin/pg_ctl -D /var/lib/pgsql/9.3/data -l logfile start
-bash-4.2$
</pre>
5. Start the postgresql server<br />
<br />
<pre>[root@fallenangel ~]# service postgresql-9.3 start
Redirecting to /bin/systemctl start postgresql-9.3.service
[root@fallenangel ~]#
</pre>
<br />
6. Connect to the Server and create a test database<br />
<br />
<pre>[root@fallenangel ~]# su - postgres
-bash-4.2$ createdb json
-bash-4.2$ psql json
psql (9.3.0)
Type "help" for help.
json=# create user json_user with password 'json_password';
CREATE ROLE
json=# grant all privileges on database json to json_user;
GRANT
json=# \q
</pre>
7. Connect to the Server with newly created Username<br />
<br />
<pre>[root@fallenangel ~]# psql -U json_user -d json
psql (9.3.0)
Type "help" for help.
</pre>
8. Create a new table with JSON datatype in one of the columns<br />
<br />
<pre>json=> create table "User" (
json(> id integer,
json(> details json
json(> );
CREATE TABLE
json=> insert into "User" (id, details) values (1, '{"uuid":1234, "name":"John Doe", "email": "John.Doe@acme.com", "status":"active"}');
INSERT 0 1
json=> insert into "User" (id, details) values (1, '{"uuid":1235, "name":"Tomcat", "email": "tomcat@acme.com", "status":"active", "phones":["+1 800 700 500", "+1 400 300 200"]}');
INSERT 0 1
json=> </pre>
9. Now the SQL Queries using NoSQL dataset<br />
<br />
<pre>1. Get the list of all UUIDs (embedded inside `details` column)
json=> select details->'uuid' as "uuid" from "User";
uuid
------
1234
1235
(2 rows)
2. Get the list of all Emails from "User" table
json=> select details->'email' as "email" from "User";
email
---------------------
"John.Doe@acme.com"
"tomcat@acme.com"
(2 rows)
3. Get the First Phone number (from the array of phones) from "User" table
json=> select details->'name' as "name", details->'phones'->0 as "uuid" from "User";
name | uuid
------------+------------------
"John Doe" |
"Tomcat" | "+1 800 700 500"
(2 rows)
</pre>
<br />
Please be aware that JSON Implies UTF-8 Charset. There is no need to explicitly mention this. <br />
<br />
More JSON functions in postgres-9.3 are available in <a href="http://www.postgresql.org/docs/9.3/static/functions-json.html">this document</a>.<br />
<br />
LIMITATIONS: Currently, to update the column, we need to pass the entire json data instead of updating a single KEY inside JSON content.<br />
<br />
For example, you might expect the following works, But it doesn't.<br />
<br />
<pre>Update the 'name' key inside the json dataset.
json=> update "User" set details->'name' = 'John Doe II' where details->'name' = 'John Doe';
ERROR: syntax error at or near "->"
LINE 1: update "User" set details->'name' = 'John Doe II' where deta..</pre>
<br />
It would be awesome if postgresql developers add such feature.
</div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com0tag:blogger.com,1999:blog-18125890.post-2190044378403311822013-09-06T09:55:00.000+05:302013-09-06T09:56:15.288+05:30Installing Facebook's Hiphop "Kimchi" Release on Centos 6.x , RHEL 6.x<div dir="ltr" style="text-align: left;" trbidi="on">
Facebook's hiphop changelog is updated for <a href="https://github.com/facebook/hiphop-php/blob/master/hphp/NEWS">"Kimchi" release</a> in <a href="https://github.com/facebook/hiphop-php">github</a> with the following list.<br />
<br />
<pre>"Kimchi" 2-Sep-2013
- Fix order of custom attributes and visibility in ctor arg promotion
- Implement CachingIterator
- Implement RecursiveCachingIterator
- Generalized heuristic for choosing when to inline in the jit
- Imported calendar extension
- Use gcc-4.8.1 by default
- Improve hhvm commandline parsing logic
- Fix register_shutdown in session_set_save_handler to match PHP 5.4
- Add "native" functions for use in Systemlib
- PHP extension source-compatitblility layer
- Fix ArrayIterator constructor PHP compatibility
- Enable building against libmemcached 1.0.8
- Debugger: $_ not cleared but still printed after exception
- Fix clone of SplPriorityQueue
- Debugger: Fix bugs when multiple threads hit the same breakpoint
- Fix several namespace bugs
- Several PHP compatibility fixes for ArrayObject and ArrayIterator
- Fix list assignment with collection literals
- support "tuple(...)" in initializer expressions
- HHVM should compile with libmemcached 1.0.9+
- Support "(new Vector {..})->method()" style syntax
- use trigger_error in PHP for Redis user errors
- multiple simplexml fixes
- fixed serialize/unserialize for SplObjectStorage
- Implement ReflectionParameter::IsCallable()
</pre>
<br />
I have pushed a new package to the <a href="http://hop5.in/">hop5.in</a> repository, Grab the package and test it out.<br />
<br />
Major change from packaging point of view is the libmemcached version, which is upgraded to 1.0.16<br />
<br />
Follow these steps to upgrade<br />
<br />
1. Enable <a href="http://hop5.in/">hop5.in</a> repository as <a href="http://nareshv.blogspot.in/2013/05/install-hhvm-hiphop-php-on-centos-64-64.html">mentioned before</a><br />
<br />
2. Do a yum upgrade (or yum install)<br />
<br />
<pre>yum install hiphop-php-2.1.210.2-1.el6 -y</pre>
<pre>Resolving Dependencies
--> Running transaction check
---> Package hiphop-php.x86_64 0:2.1.210-4.el6 will be updated
---> Package hiphop-php.x86_64 0:2.1.210.2-1.el6 will be an update
--> Processing Dependency: libmemcached >= 1.0.9 for package: hiphop-php-2.1.210.2-1.el6.x86_64
--> Processing Dependency: libmemcached.so.11()(64bit) for package: hiphop-php-2.1.210.2-1.el6.x86_64
--> Running transaction check
---> Package libmemcached.x86_64 0:0.49-1.el6 will be updated
---> Package libmemcached.x86_64 0:1.0.16-1.el6 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Updating:
hiphop-php x86_64 2.1.210.2-1.el6 hop5 19 M
Updating for dependencies:
libmemcached x86_64 1.0.16-1.el6 hop5 208 k
Transaction Summary
================================================================================
Upgrade 2 Package(s)
Total download size: 19 M
Downloading Packages:
--------------------------------------------------------------------------------
Total 777 kB/s | 19 MB 00:24
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : libmemcached-1.0.16-1.el6.x86_64 1/4
Updating : hiphop-php-2.1.210.2-1.el6.x86_64 2/4
Cleanup : hiphop-php-2.1.210-4.el6.x86_64 3/4
Cleanup : libmemcached-0.49-1.el6.x86_64 4/4
Verifying : hiphop-php-2.1.210.2-1.el6.x86_64 1/4
Verifying : libmemcached-1.0.16-1.el6.x86_64 2/4
Verifying : hiphop-php-2.1.210-4.el6.x86_64 3/4
Verifying : libmemcached-0.49-1.el6.x86_64 4/4
Updated:
hiphop-php.x86_64 0:2.1.210.2-1.el6
Dependency Updated:
libmemcached.x86_64 0:1.0.16-1.el6
Complete!
</pre>
3. See that new package is installed<br />
<br />
<pre>bash-4.1# rpm -qa | grep hiphop-php
hiphop-php-2.1.210.2-1.el6.x86_64
</pre>
4. Check the hhvm version details<br />
<br />
<pre>bash-4.1# /usr/bin/hhvm --version
HipHop VM v2.1.0-dev (rel)
Compiler: heads/master-0-g13ddbb4ec17cffeeaaa83940016e6811cd71b387
Repo schema: a40e2fdb7f3c4700ef306f956630f09cd1ba53e0</pre>
<pre>bash-4.1# cd /var/www && /usr/bin/hhvm index.php
Hello world.</pre>
5. Have fun!<br />
<br />
</div>
NOTE: Please be aware that, from facebook's point of view this is just a internal release in the <b>2.1.0-dev</b> series.<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com0tag:blogger.com,1999:blog-18125890.post-65001600962695895872013-09-02T07:18:00.002+05:302013-09-06T10:00:12.925+05:30Getting ready for the faster HHVM (hiphop php) version<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #f3f3f3;"><span style="background-color: orange;">UPDATE: Now you can install <a href="http://nareshv.blogspot.in/2013/09/installing-facebooks-hiphop-kimchi.html">"Kimchi"</a> release as of 6-Sep-2013 </span></span><br />
<br />
HHVM (hiphop php) is getting ready for a faster version with the <a href="https://raw.github.com/facebook/hiphop-php/master/hphp/NEWS">following changes</a><br />
<br />
I have built a preview version as of Sep-1-2013, which can be easily installed on your system.<br />
<h3 style="text-align: left;">
Steps to Upgrade from 2.1.0 on CentOS-6.x / RHEL-6.x</h3>
<br />
1. Make sure you have enabled <a href="http://hop5.in/">hop5.in</a> repository as mentioned in <a href="http://nareshv.blogspot.in/2013/05/install-hhvm-hiphop-php-on-centos-64-64.html">this</a> blog post.<br />
<br />
2. Update hiphop-php<br />
<br />
<pre>[nareshv@fallenangel ~]$ sudo yum install hiphop-php-2.1.210.1-1.el6
Total download size: 19 M
Is this ok [y/N]: y
Downloading Packages:
hiphop-php-2.1.210.1-1.el6.x86_64.rpm | 19 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : hiphop-php-2.1.210.1-1.el6.x86_64 1/2
Cleanup : hiphop-php-2.1.210-4.el6.x86_64 2/2
Verifying : hiphop-php-2.1.210.1-1.el6.x86_64 1/2
Verifying : hiphop-php-2.1.210-4.el6.x86_64 2/2
Updated:
hiphop-php.x86_64 0:2.1.210.1-1.el6
Complete!
</pre>
<br />
3. Check the version of new Hiphop<br />
<br />
<pre>[nareshv@fallenangel ~]$ /usr/bin/hhvm --version
HipHop VM v2.1.0-dev (rel)
Compiler: heads/master-0-ged8774975e0c017b8baf09d1547d769b26c5f278
Repo schema: d74c9a7e6b05d0018945a73ae5567bafa294f29d</pre>
<br />
<span style="background-color: yellow;">NOTES:Be sure to test this preview release on your testing environment before using it on production.</span></div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com0tag:blogger.com,1999:blog-18125890.post-29908444390559537882013-09-01T09:40:00.003+05:302013-09-01T09:40:50.662+05:30Installing Docker.io version 0.6.1 on Centos / Fedora<div dir="ltr" style="text-align: left;" trbidi="on">
Docker.io has released 0.6.1 version with the following <a href="https://github.com/dotcloud/docker/blob/5105263dacc9372771d9bf478dcac6fceedb9a30/CHANGELOG.md">changelog</a><br />
<br />
If you have already installed docker.io on your centos/rhel system. Just do the upgrade with the following steps<br />
<br />
<h3 style="text-align: left;">
Upgrading from 0.5.3 to 0.6.1</h3>
<div style="text-align: left;">
1. Make sure you have enabled hop5.in repository as mentioned in <a href="http://nareshv.blogspot.in/2013/08/installing-dockerio-on-centos-64-64-bit.html">previous post</a><br />
<br />
2. Do a yum upgrade</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<pre>yum update docker-io
</pre>
</div>
<br /></div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com0tag:blogger.com,1999:blog-18125890.post-11974173337094922272013-08-21T09:11:00.001+05:302013-10-07T10:22:13.623+05:30Installing docker.io on centos 6.4 (64-bit)<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: #e06666;">NOTES: epel has another package called docker (which is a KDE docking application and is not related to this). So, you will get an error performing these steps, if you have that package already installed.</span><br />
<br />
<span style="color: #eeeeee;"><span style="background-color: #6aa84f;">UPDATE-1: Docker version-0.6.1 is released. Upgrade instructions are <a href="http://nareshv.blogspot.in/2013/09/installing-dockerio-version-061-on.html">available here</a></span></span><br />
<br />
<span style="color: #eeeeee;"><span style="background-color: #6aa84f;">UPDATE-2: Docker version-0.6.2 is released. <a href="http://nareshv.blogspot.in/2013/09/installing-dockerio-version-061-on.html"></a> </span></span><br />
<br />
<a href="http://docker.io/">Docker.io</a> is the lightweight <i>"container engine + image repository"</i> built on top of LXC (linux lightweight containers) to ship any application.<br />
<br />
At the core of docker.io there are<br />
<ol style="text-align: left;">
<li> an application <i>"/usr/bin/docker"</i> </li>
<li> set of pre-created operating-system/application images hosted with "docker.io"</li>
<li> AUFS (Another Union filesystem) to take care of snapshots, diffs, ro/rw requirements</li>
<li>LXC (Linux lightweight containers)</li>
<li>cgroups (for resource management and namespacing)</li>
</ol>
As of writing this blog, the latest version is 0.5.3 . The project is actively being developed and things can change in near future.<br />
<br />
Follow these instructions to get docker.io installed on your system.<br />
<br />
0. Install centos 6.x<br />
<br />
1. Disable selinux as it interferes with functionality of LXC<br />
<br />
<pre>[root@localhost ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
</pre>
2. Download and setup <a href="https://fedoraproject.org/wiki/EPEL">Fedora EPEL</a> Repository<br />
<br />
<pre>sudo yum install http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm</pre>
<br />
3. Setup <a href="http://hop5.in/">hop5.in</a> repository<br />
<br />
<pre>cd /etc/yum.repos.d
sudo wget http://www.hop5.in/yum/el6/hop5.repo</pre>
<br />
4. Install docker-io package<br />
<br />
<pre>[root@localhost ~]# yum install docker-io
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* epel: kartolo.sby.datautama.net.id
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package docker-io.x86_64 0:0.5.3-4.el6 will be installed
--> Processing Dependency: lxc >= 0.8.0 for package: docker-io-0.5.3-4.el6.x86_64
--> Processing Dependency: kernel-ml-aufs >= 3.10.5 for package: docker-io-0.5.3-4.el6.x86_64
--> Running transaction check
---> Package kernel-ml-aufs.x86_64 0:3.10.5-3.el6 will be installed
---> Package lxc.x86_64 0:0.8.0-3.el6 will be installed
--> Processing Dependency: liblxc.so.0()(64bit) for package: lxc-0.8.0-3.el6.x86_64
--> Running transaction check
---> Package lxc-libs.x86_64 0:0.8.0-3.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================
Package Arch Version Repository Size
============================================================================================
Installing:
docker-io x86_64 0.5.3-4.el6 hop5 1.2 M
Installing for dependencies:
kernel-ml-aufs x86_64 3.10.5-3.el6 hop5 33 M
lxc x86_64 0.8.0-3.el6 hop5 81 k
lxc-libs x86_64 0.8.0-3.el6 hop5 75 k
Transaction Summary
============================================================================================
Install 4 Package(s)
Total download size: 34 M
Installed size: 159 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): docker-io-0.5.3-4.el6.x86_64.rpm | 1.2 MB 00:03
(2/4): kernel-ml-aufs-3.10.5-3.el6.x86_64.rpm | 33 MB 00:33
(3/4): lxc-0.8.0-3.el6.x86_64.rpm | 81 kB 00:00
(4/4): lxc-libs-0.8.0-3.el6.x86_64.rpm | 75 kB 00:00
--------------------------------------------------------------------------------------------
Total 896 kB/s | 34 MB 00:39
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : lxc-libs-0.8.0-3.el6.x86_64 1/4
Installing : lxc-0.8.0-3.el6.x86_64 2/4
Installing : kernel-ml-aufs-3.10.5-3.el6.x86_64 3/4
Installing : docker-io-0.5.3-4.el6.x86_64 4/4
Verifying : kernel-ml-aufs-3.10.5-3.el6.x86_64 1/4
Verifying : lxc-0.8.0-3.el6.x86_64 2/4
Verifying : lxc-libs-0.8.0-3.el6.x86_64 3/4
Verifying : docker-io-0.5.3-4.el6.x86_64 4/4
Installed:
docker-io.x86_64 0:0.5.3-4.el6
Dependency Installed:
kernel-ml-aufs.x86_64 0:3.10.5-3.el6 lxc.x86_64 0:0.8.0-3.el6
lxc-libs.x86_64 0:0.8.0-3.el6
Complete!
[root@localhost ~]#
</pre>
<br />
5. See the package is installed correctly<br />
<br />
<pre>[root@localhost ~]# docker -h
Usage of docker:
-D=false: Debug mode
-H=[unix:///var/run/docker.sock]: tcp://host:port to bind/connect to or unix://path/to/socket to use
-api-enable-cors=false: Enable CORS requests in the remote api.
-b="": Attach containers to a pre-existing network bridge. Use 'none' to disable container networking
-d=false: Daemon mode
-dns="": Set custom dns servers
-g="/var/lib/docker": Path to graph storage base dir.
-p="/var/run/docker.pid": File containing process PID
-r=false: Restart previously running containers
</pre>
<br />
6. Add cgroup filesystem to /etc/fstab , so that docker will work correctly<br />
<br />
<pre>[root@localhost ~]# echo "none /sys/fs/cgroup cgroup defaults 0 0" >> /etc/fstab </pre>
<pre><strike>[root@localhost ~]# mount /sys/fs/cgroup</strike></pre>
<br />
Per "Peter Zimmerman" a reboot is needed to actually mount /sys/fs/cgroup (due to the kernel doesn't have cgroup support). So, the above mount step is not really needed. As its used only upon reboot.<br />
<br />
7. Reboot the system ; make sure to select "3.10.5-3.el6.x86_64" kernel version while booting.<br />
<br />
8. Once system is up and running, make sure you are on right kernel<br />
<br />
<pre>[root@localhost ~]# uname -r
3.10.5-3.el6.x86_64
[root@localhost ~]# grep aufs /proc/filesystems
nodev aufs
</pre>
9. Start the docker.io in daemon mode (in a different terminal)<br />
<br />
<pre>[root@localhost ~]# docker -d
2013/08/21 07:47:07 WARNING: Your kernel does not support cgroup swap limit.
2013/08/21 07:47:07 Listening for HTTP on /var/run/docker.sock (unix)</pre>
<br />
10. Print hello world from a centos 6.4 container.<br />
<br />
<pre>[root@localhost ~]# docker run centos:6.4 echo "hello world"
2013/08/21 07:48:41 POST /v1.4/containers/create
2013/08/21 07:48:41 POST /v1.4/containers/c6bc9e80097e/start
2013/08/21 07:48:41 POST /v1.4/containers/c6bc9e80097e/attach?logs=1&stderr=1&stdout=1&stream=1
hello world
</pre>
<br />
11. Ping from inside the container<br />
<pre>[root@localhost ~]# docker -dns '8.8.8.8' run centos:6.4 ping -c 3 yahoo.com
2013/08/21 08:02:15 POST /v1.4/containers/create
2013/08/21 08:02:15 POST /v1.4/containers/c40a1244f9bc/start
2013/08/21 08:02:15 POST /v1.4/containers/c40a1244f9bc/attach?logs=1&stderr=1&stdout=1&stream=1
PING yahoo.com (98.138.253.109) 56(84) bytes of data.
64 bytes from ir1.fp.vip.ne1.yahoo.com (98.138.253.109): icmp_seq=1 ttl=48 time=323 ms
64 bytes from ir1.fp.vip.ne1.yahoo.com (98.138.253.109): icmp_seq=2 ttl=48 time=329 ms
64 bytes from ir1.fp.vip.ne1.yahoo.com (98.138.253.109): icmp_seq=3 ttl=49 time=302 ms
--- yahoo.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2304ms
rtt min/avg/max/mdev = 302.032/318.318/329.656/11.807 ms</pre>
<h3 style="text-align: left;">
TROUBLESHOOTING</h3>
<div style="text-align: left;">
"DNS/Networking Errors inside the docker"</div>
<div style="text-align: left;">
<br /></div>
<pre>[root@localhost ~]# docker -dns="8.8.8.8" run centos:6.4 yum install hiphop-php
2013/08/21 07:53:05 POST /v1.4/containers/create
2013/08/21 07:53:05 POST /v1.4/containers/6d9fef14bd1a/start
2013/08/21 07:53:05 POST /v1.4/containers/6d9fef14bd1a/attach?logs=1&stderr=1&stdout=1&stream=1
Loaded plugins: fastestmirror
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"</pre>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Please issue the <a href="https://github.com/dotcloud/docker/issues/866?source=c#issuecomment-19218300">following commands</a>, so that docker and its environment will be reset and above issue will be taken care of.</div>
<div style="text-align: left;">
<br /></div>
<pre><code>pkill docker
iptables -t nat -F
ifconfig docker0 down
brctl delbr docker0
docker -d</code></pre>
<div style="text-align: left;">
<br /></div>
<span style="background-color: yellow;">CREDITS: Thanks to <span style="color: black;"><a href="https://github.com/sciurus/docker-rhel-rpm">sciurus</a> for doing the hardwork in creating the spec file for kernel-ml-aufs. </span></span></div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com10tag:blogger.com,1999:blog-18125890.post-24104107238917369712013-08-19T07:24:00.004+05:302014-04-28T09:45:34.213+05:30Installing Go Lang 1.1 on centos 6.4 *64-bit<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #351c75;"><span style="background-color: #ffd966;">UPDATE: 28/Apr/2014 - Golang package is now available on Fedora EPEL Repository. You can just configure <a href="http://koji.fedoraproject.org/koji/buildinfo?buildID=502239" target="_blank">EPEL repo</a> and do a "yum install golang".</span></span><br />
<br />
I have added <a href="http://golang.org/">go-lang</a> package to the current repository. So you can try installing it using the following steps.<br />
<br />
1. Install centos 6.x<br />
<br />
2. Download and setup <a href="https://fedoraproject.org/wiki/EPEL">Fedora EPEL</a> Repository<br />
<br />
<pre>sudo yum install http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm</pre>
<br />
(Step-3 not needed, if you are seeing this on Apr/2014)<br />
<br />
<strike>3. Setup <a href="http://hop5.in/">hop5.in</a> repository</strike><br />
<strike><br /></strike>
<br />
<pre><strike>cd /etc/yum.repos.d
sudo wget http://www.hop5.in/yum/el6/hop5.repo</strike></pre>
<br />
4. Install go package<br />
<br />
<pre>sudo yum install golang</pre>
<br />
5. Write a simple "hello world" program to get started with go<br />
<br />
<pre>[nareshv@fallenangel tmp]$ cat hello.go</pre>
<pre>package main</pre>
<pre>
</pre>
<pre>import "fmt"
func main() {
fmt.Println("Hello, World.")
}
</pre>
<pre>[nareshv@fallenangel tmp]$ go run hello.go
Hello, World. </pre>
<br />
6. Continue exploring <a href="http://golang.org/">go-lang</a>, from <a href="http://tour.golang.org/#1">here</a><br />
<br />
(Note is not applicable if you are using golang from EPEL Repository)<br />
<br />
<strike><span style="background-color: yellow;">Note: Please note that, go-lang is compiled without emacs support (to avoid pulling tons of packages) and with gcc-4.6.3.</span></strike></div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com9tag:blogger.com,1999:blog-18125890.post-83064928969896220092013-07-15T06:57:00.000+05:302013-07-15T07:02:43.517+05:30Installing HHVM (Hiphop PHP) 2.1.0 On Centos 6.x<div dir="ltr" style="text-align: left;" trbidi="on">
HHVM 2.1.0 was <a href="http://nareshv.blogspot.in/2013/07/hhvm-hiphop-php-210-final-got-released.html">released a day ago</a> (as of writing this blog). In order to install this stable version on your server / development environment. Follow these steps<br />
<br />
1. <a href="http://nareshv.blogspot.in/2013/05/install-hhvm-hiphop-php-on-centos-64-64.html">Configure the Repository as mentioned in my previous post </a><br />
<br />
2. Upgrade to the latest version<br />
<br />
<pre>sudo yum update hiphop-php
</pre>
<br />
3. Confirm that the package is installed correctly<br />
<br />
<pre>/usr/bin/hhvm --help
</pre>
<br />
<span style="background-color: black;"><span style="color: yellow;">NOTE: You need to re-build your we-application (if you are using repo-authoritative mode) with the current version and then only upgrade your production server, or else you might not have this application working correctly.</span></span><br />
<br />
Have fun with this stable version.</div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com6tag:blogger.com,1999:blog-18125890.post-59748685870342042452013-07-13T08:20:00.002+05:302013-07-13T08:25:16.292+05:30HHVM (Hiphop PHP) 2.1.0 Final Got Released<div dir="ltr" style="text-align: left;" trbidi="on">
9 Hours ago, as of i am writing this blog, HHVM 2.1.0 Final got released. <a href="https://github.com/facebook/hiphop-php/commit/ee8da60efaad9398eb4fb5909ede5cf6bb662128">commit link</a> is here.<br />
<br />
There is no full changelog available yet. But, i am compiling this at this moment and packages for Centos 6.x 64-bit should be available soon.</div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com0tag:blogger.com,1999:blog-18125890.post-29916541003398736192013-07-10T20:25:00.000+05:302013-07-13T08:25:45.384+05:30Install TokuDB Mysql Server along with Existing mysql-server on Centos/Ubuntu Server <div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
Tokudb has fractal tree engine which is mentioned to perform bettern than innodb in certain instances. In some scenarios you might want to run mysql-server which is patched with tokudb engine along with your current mysql server (for performance testing, evaluation etc).</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
A straightforward installation will mess up /var/lib/mysql, so follow these instructions to make sure that the server installation doesn't mess up existing installation.</div>
<br />
1. Download and unzip the tokudb to /usr/local/<br />
<br />
<pre>nareshv@fallenangel:~/Downloads$ sudo mv mysql-5.5.30-tokudb-7.0.1-linux-x86_64 /usr/local/
nareshv@fallenangel:/usr/local$ sudo ln -s mysql-5.5.30-tokudb-7.0.1-linux-x86_64 mysql
nareshv@fallenangel:/usr/local$ cd mysql
nareshv@fallenangel:/usr/local/mysql$ ls -l
total 80
drwxrwxr-x 2 nareshv nareshv 4096 Apr 19 04:57 bin
-rw-r--r-- 1 nareshv nareshv 17987 Apr 19 03:11 COPYING
drwxrwxr-x 4 nareshv nareshv 4096 Apr 19 04:57 data
drwxrwxr-x 2 nareshv nareshv 4096 Apr 19 04:57 docs
drwxrwxr-x 3 nareshv nareshv 4096 Apr 19 04:57 include
-rw-r--r-- 1 nareshv nareshv 7469 Apr 19 03:11 INSTALL-BINARY
drwxrwxr-x 3 nareshv nareshv 4096 Apr 19 04:57 lib
drwxrwxr-x 4 nareshv nareshv 4096 Apr 19 04:57 man
drwxrwxr-x 10 nareshv nareshv 4096 Apr 19 04:57 mysql-test
-rw-r--r-- 1 nareshv nareshv 2552 Apr 19 03:11 README
-rw-r--r-- 1 nareshv nareshv 3659 Apr 19 04:52 README-TOKUDB
drwxrwxr-x 2 nareshv nareshv 4096 Apr 19 04:57 scripts
drwxrwxr-x 27 nareshv nareshv 4096 Apr 19 04:57 share
drwxrwxr-x 4 nareshv nareshv 4096 Apr 19 04:57 sql-bench
drwxrwxr-x 2 nareshv nareshv 4096 Apr 19 04:57 support-files</pre>
<br />
2. Install the mysqlserver to /usr/local/mysql (not /var/lib/mysql)<br />
<br />
<pre>nareshv@fallenangel:/usr/local/mysql$ sudo -u mysql ./scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql</pre>
<pre>Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h fallenangel password 'new-password'
Alternatively you can run:
/usr/local/mysql/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/local/mysql/scripts/mysqlbug script!</pre>
<br />
3. Create a new startup script to launch mysqld on port 3307<br />
<br />
<pre>nareshv@fallenangel:/usr/local/mysql-5.5.30-tokudb-7.0.1-linux-x86_64$ sudo vi run.sh
#!/bin/bash
/usr/bin/env MYSQL_HOME=/usr/local/mysql ./bin/mysqld --user=mysql \
--pid-file=/usr/local/mysql/mysqld.pid \
--socket=/usr/local/mysql/mysqld.sock \
--port=3307 \
--basedir=/usr/local/mysql \
--datadir=/usr/local/mysql/data \
--lc-messages-dir=/usr/local/mysql/share \
--tmpdir=/tmp \
--skip-external-locking \
--bind-address=127.0.0.1 \
nareshv@fallenangel:/usr/local/mysql-5.5.30-tokudb-7.0.1-linux-x86_64$</pre>
<br />
4. Run the mysql server in another terminal as root user<br />
<br />
<pre>nareshv@fallenangel:/usr/local/mysql-5.5.30-tokudb-7.0.1-linux-x86_64$ sudo ./run.sh
</pre>
<br />
5. Connect and check if mysql is available on 3307 / 127.0.0.1 <br />
<br />
<pre>nareshv@fallenangel:/usr/local/mysql-5.5.30-tokudb-7.0.1-linux-x86_64$ mysql -u root -h 127.0.0.1 -P 3307
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.30-tokudb-7.0.1 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql> quit
Bye
Confirm that variables point to /usr/share/mysql only
mysql> show variables like '%dir%';
+-----------------------------------------+-------------------------------------------------------------------+
| Variable_name | Value |
+-----------------------------------------+-------------------------------------------------------------------+
| basedir | /usr/local/mysql |
| binlog_direct_non_transactional_updates | OFF |
| character_sets_dir | /usr/local/mysql-5.5.30-tokudb-7.0.1-linux-x86_64/share/charsets/ |
| datadir | /usr/local/mysql/data/ |
| innodb_data_home_dir | /usr/local/mysql/data |
| innodb_log_group_home_dir | /usr/local/mysql/data |
| innodb_max_dirty_pages_pct | 75 |
| lc_messages_dir | /usr/local/mysql/share/ |
| plugin_dir | /usr/local/mysql-5.5.30-tokudb-7.0.1-linux-x86_64/lib/plugin/ |
| slave_load_tmpdir | /tmp |
| tmpdir | /tmp |
| tokudb_data_dir | |
| tokudb_directio | OFF |
| tokudb_log_dir | |
| tokudb_tmp_dir | |
+-----------------------------------------+-------------------------------------------------------------------+
15 rows in set (0.00 sec)</pre>
<br /></div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com4tag:blogger.com,1999:blog-18125890.post-48390767453156865202013-05-17T09:57:00.000+05:302014-04-27T07:40:50.888+05:30Install HHVM (Hiphop PHP) on Centos 6.4 (64-bit)<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: yellow;">UPDATED: 10/July/2013 - Fixed the errors which are causing repo not available. Sorry for the trouble.</span><br />
<br />
<span style="color: #0c343d;"><span style="background-color: yellow;">UPDATEd: 19/Oct/2013 - HHVM 2.2.0 Release is <a href="http://nareshv.blogspot.in/2013/10/install-hhvm-220-final-release-on.html">available now</a></span></span><br />
<br />
<span style="color: #0c343d;"><span style="background-color: yellow;">UPDATED: 18/Dec/2013 - HHVM 2.3.0 Release is <a href="http://nareshv.blogspot.com/2013/12/installing-hhvm-23-on-centos-65.html">available now</a> </span></span><br />
<br />
<span style="color: #0c343d;"><span style="background-color: yellow;">UPDATED: 14/Apr/2014 - HHVM 3.0.1 Release is <a href="http://nareshv.blogspot.com/2014/04/installing-hhvm-301-on-centos-65-64-bit.html">available now</a> </span></span><br />
<br />
I have created a repository and compiled HHVM (v2 of HPHP) rpm packages. Follow these steps to get started.<br />
<br />
1. Install Centos 6.x (minimal is preferred)<br />
<br />
2. Install epel repository<br />
<br />
<pre>sudo yum install http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
</pre>
<br />
(or get the latest version from http://ftp.riken.jp/Linux/fedora/epel/6/i386/repoview/epel-release.html)<br />
<br />
3. download the hop5 repository configuration file<br />
<br />
<pre>cd /etc/yum.repos.d
sudo wget http://www.hop5.in/yum/el6/hop5.repo</pre>
<pre> </pre>
</div>
<i><span style="color: #cc0000;">If you are here after Mar-2014, use <b>hhvm</b> as package name instead of <b>hiphop-php</b></span></i><br />
<br />
4. Install hiphop-php
<br />
<pre>sudo yum install hiphop-php</pre>
<br />
5. Follow the instructions at https://github.com/facebook/hiphop-php to get started<br />
<br />
<br />
<span style="color: red;">Please note that, i have compiled the required rpms from fedora
distribution. DO NOT FILE ANY BUGS WITH CENTOS/FEDORA regarding the rpms
that you are about to install from this repoisitory.</span>
</div>
<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com67tag:blogger.com,1999:blog-18125890.post-22526729268416558982011-11-20T12:34:00.003+05:302011-11-20T12:43:22.572+05:30Fixing Redmine user page-load-error on Debian 6<div dir="ltr" style="text-align: left;" trbidi="on">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.<br /><br />Error look something like this.<br /><br /><br /><pre>ActionView::TemplateError (undefined method `html_safe' for "user@mycompany.com":String) on line #10 of app/views/users/show.rhtml:</pre><div><span class="Apple-style-span" style="font-family: inherit;">Solution to this problem is to apply this patch.</span><br /><span class="Apple-style-span" style="font-family: inherit;"><br /></span><br /><br /></div><pre>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# </pre></div><div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com0tag:blogger.com,1999:blog-18125890.post-30828448826160952632011-10-31T10:35:00.009+05:302011-11-14T18:14:28.390+05:30Building Facebook's HipHop on Fedora 15<div dir="ltr" style="text-align: left;" trbidi="on">
Facebook has <a href="http://developers.facebook.com/blog/post/358/">opensourced</a> 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.<br />
<br />
Before you get started. Please visit the <a href="https://github.com/facebook/hiphop-php">main home page</a> of the hiphop Project itself.<br />
<br />
On github you see the list of all the pre-requisites. First lets get our development environment ready.<br />
<br />
<br />
<span style="font-weight: bold;">Prerequisites.</span><br />
<br />
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.<br />
<br />
1. Install the <span style="font-weight: bold;">Fedora Packager</span> packages<br />
<br />
<pre>
[root@nareshv-build64 ~]# yum groupinstall "Fedora Packager"
</pre>
<br />
<br />
2. Make sure you have git and c++ compiler<br />
<br />
<pre>
[root@nareshv-build64 ~]# yum install gcc-c++ git wget
</pre>
<br />
<br />
3. Install all the pre-requisites as mentioned in the <a href="https://github.com/facebook/hiphop-php">hiphop wiki</a><br />
<br />
<pre>
[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
</pre>
<br />
<br />
4. Now we have to build <span style="font-weight: bold;">libevent-1.4</span> and <span style="font-weight: bold;">curl</span> packages on our own as facebook has made some patches to those packages.<br />
<br />
5. Lets create the environment for building the packages<br />
<br />
6. Create workspace for checking out the hiphop source code.<br />
<br />
<pre>
[root@nareshv-build64 ~]# cd $HOME/
[root@nareshv-build64 ~]# mkdir -p $HOME/dev/hiphop/ $HOME/dev/hiphop/usr
[root@nareshv-build64 ~]# cd $HOME/dev/hiphop
</pre>
<br />
<br />
7. Checkout the hiphop source code<br />
<br />
<pre>
[root@nareshv-build64 ~]# cd $HOME/dev/hiphop/ && git clone git://github.com/facebook/hiphop-php.git
</pre>
<br />
<br />
<br />
8. Download curl and libevent for building locally<br />
<br />
<pre>
[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</pre>
<pre>[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/
</pre>
<br />
<br />
9. Now get ready to build hiphop itself<br />
<br />
<pre>
[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
</pre>
<br />
<br />
10. You will encounter some errors related to 'c-client version should be higher than 2007'.<br />
<br />
On fedora the package is called libc-client and libc-client-devel and the includes are present in /usr/include/imap/ folders.<br />
<br />
Lets adjust the CMakeCache.txt like this.<br />
<br />
<pre>
[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
</pre>
<br />
<br />
11. Build again.<br />
<br />
<pre>
[root@nareshv-build64 hiphop-php]# cd $HOME/dev/hiphop/hiphop-php/
[root@nareshv-build64 hiphop-php]# cmake .
[root@nareshv-build64 hiphop-php]# make
</pre>
<br />
<br />
12. Now it will fail at mysql related references like this<br />
<br />
<pre>
[ 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
</pre>
<br />
<br />
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.<br />
<br />
12.1 Download the mysql .src.rpm from koji<br />
<br />
I went to <a href="http://koji.fedoraproject.org/koji/buildinfo?buildID=268920">http://koji.fedoraproject.org/koji/buildinfo?buildID=268920</a><br />
<br />
and downloaded the following .src.rpm<br />
<br />
<a href="http://kojipkgs.fedoraproject.org/packages/mysql/5.5.16/3.fc17/src/mysql-5.5.16-3.fc17.src.rpm">http://kojipkgs.fedoraproject.org/packages/mysql/5.5.16/3.fc17/src/mysql-5.5.16-3.fc17.src.rpm</a><br />
<br />
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)<br />
<br />
<pre>
[root@nareshv-build64 hiphop-php]# rpm -Uvh mysql-5.5.16-3.fc17.src.rpm
</pre>
<br />
<br />
12.3 Update the libmysql.version file<br />
<br />
<pre>
[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;
<span style="color: yellow; font-weight: bold;"># Hiphop needs it
cli_safe_read;
net_field_length;
cli_safe_read;
free_root;</span>
};</pre>
<br />
<br />
12.4 Rebuild the RPM<br />
<br />
<pre>
[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</pre>
<br />
<br />
12.5 Install the RPM Files happily<br />
<br />
<pre>
[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
</pre>
<br />
<br />
13. Now build hiphop again<br />
<br />
<pre>
[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</pre>
<br />
<br />
14. You should have the binary created<br />
<br />
<pre>
[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> <inputs>
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);
</inputs></options></pre>
<br />
<br />
15. Now continue with the rest of the tutorial on <a href="https://github.com/facebook/hiphop-php/wiki/Running-HipHop">how to get your code compiled</a> in the main hiphop project page itself.</div><div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com5tag:blogger.com,1999:blog-18125890.post-70095018310150170062011-06-29T22:25:00.007+05:302011-06-30T11:22:24.389+05:30Node.js on Fedora 15Since currently there is no easy way to install <a href="http://nodejs.org/">node.js</a> via yum repository. Here is how you can quickly get the node.js installed on your fedora-15 box<br /><br />1. Install fedora packager rpms (as root)<br /><br /><pre><br /><br />[nareshv@localhost SRPMS]$ sudo yum groupinstall "Fedora Packager"<br /><br /></pre><br /><br />2. Create the setup environment for building RPM (for non-root users)<br /><br /><pre><br /><br />[nareshv@localhost ~]$ rpmdev-setuptree<br /><br /></pre><br /><br />3. Download the SRPM (as nonroot)<br /><br /><pre><br /><br />[nareshv@localhost ~]$ cd rpmbuild/SRPMS/<br />[nareshv@localhost SRPMS]$ ls<br />[nareshv@localhost SRPMS]$ wget http://v3.sk/~lkundrak/SRPMS/nodejs-0.4.1-1.el6.src.rpm<br />--2011-06-29 22:18:50-- http://v3.sk/~lkundrak/SRPMS/nodejs-0.4.1-1.el6.src.rpm<br />Resolving v3.sk... 91.210.183.14<br />Connecting to v3.sk|91.210.183.14|:80... connected.<br />HTTP request sent, awaiting response... 200 OK<br />Length: 4859437 (4.6M) [application/x-rpm]<br />Saving to: ânodejs-0.4.1-1.el6.src.rpmâ<br /><br />100%[====================================================>] 4,859,437 600K/s in 11s<br /><br />2011-06-29 22:19:03 (444 KB/s) - nodejs-0.4.1-1.el6.src.rpm<br /><br /></pre><br /><br />4. Install the dependencies for the RPM (as root)<br /><br /><pre><br /><br />[nareshv@localhost SRPMS]$ sudo yum install openssl-devel v8-devel c-ares-devel \<br /> libev-devel libeio-devel http-parser-devel \<br /> waf libgpg-error-devel \<br /> libstdc++-devel gcc-c++ -y<br /><br /><br /></pre><br /><br />5. Build the RPM (as non-root)<br /><br /><pre><br /><br />[nareshv@localhost SRPMS]$ rpmbuild --rebuild nodejs-0.4.1-1.el6.src.rpm<br />...<br />...<br />...<br />Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.OWCyPT<br />+ umask 022<br />+ cd /home/nareshv/rpmbuild/BUILD<br />+ cd node-v0.4.1<br />+ DOCDIR=/home/nareshv/rpmbuild/BUILDROOT/nodejs-0.4.1-1.el6.x86_64/usr/share/doc/nodejs-0.4.1<br />+ export DOCDIR<br />+ rm -rf /home/nareshv/rpmbuild/BUILDROOT/nodejs-0.4.1-1.el6.x86_64/usr/share/doc/nodejs-0.4.1<br />+ /bin/mkdir -p /home/nareshv/rpmbuild/BUILDROOT/nodejs-0.4.1-1.el6.x86_64/usr/share/doc/nodejs-0.4.1<br />+ 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<br />+ exit 0<br />Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1<br />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)<br />Processing files: nodejs-devel-0.4.1-1.fc15.x86_64<br />Provides: pkgconfig(nodejs) = 0.3.2<br />Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1<br />Requires: /usr/bin/pkg-config<br />Processing files: nodejs-debuginfo-0.4.1-1.fc15.x86_64<br />Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/nareshv/rpmbuild/BUILDROOT/nodejs-0.4.1-1.el6.x86_64<br />Wrote: /home/nareshv/rpmbuild/RPMS/x86_64/nodejs-0.4.1-1.fc15.x86_64.rpm<br />Wrote: /home/nareshv/rpmbuild/RPMS/x86_64/nodejs-devel-0.4.1-1.fc15.x86_64.rpm<br />Wrote: /home/nareshv/rpmbuild/RPMS/x86_64/nodejs-debuginfo-0.4.1-1.fc15.x86_64.rpm<br />Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.ume4Ra<br />+ umask 022<br />+ cd /home/nareshv/rpmbuild/BUILD<br />+ cd node-v0.4.1<br />+ rm -rf /home/nareshv/rpmbuild/BUILDROOT/nodejs-0.4.1-1.el6.x86_64<br />+ exit 0<br />Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.goIXqg<br />+ umask 022<br />+ cd /home/nareshv/rpmbuild/BUILD<br />+ rm -rf node-v0.4.1<br />+ exit 0<br /><br /></pre><br /><br />6. Install the RPM (as root)<br /><br /><pre><br /><br />[nareshv@localhost SRPMS]$ sudo yum install /home/nareshv/rpmbuild/RPMS/x86_64/nodejs-0.4.1-1.fc15.x86_64.rpm --nogpg -y<br /><br /><br /></pre><br /><br />7. Start <a href="http://nodejs.org/">node.js </a><br /><br /><pre><br /><br />[nareshv@localhost ~]$ node<br />> console.log("hello world!")<br />hello world!<br />> <br /><br /></pre><br /><br />Thats it!. Now you have <a href="http://nodejs.org/">node.js</a> installed on your box. <br /><br />Have a look at <a href="https://github.com/joyent/node/wiki/modules">list of plugins</a> and start playing with them.<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com5tag:blogger.com,1999:blog-18125890.post-49186293949101977602011-06-06T19:20:00.003+05:302011-06-06T19:34:43.696+05:30Smashing Book 2<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-zZ-eYVTPYbA/TezdveXiHhI/AAAAAAAAACs/gHyQPWDwJOY/s1600/IMG_0431.JPG"><img style="cursor:pointer; cursor:hand;width: 300px; height: 400px;" src="http://2.bp.blogspot.com/-zZ-eYVTPYbA/TezdveXiHhI/AAAAAAAAACs/gHyQPWDwJOY/s400/IMG_0431.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5615106643099524626" /></a><br /><br />I really love the new <a href="https://shop.smashingmagazine.com/">Smashing Book 2</a>.<br /><br />I have placed the order, the moment they released it to everyone. Somehow for the first <span style="font-weight:bold;">two times</span> i never got the book. <span style="font-weight:bold;">Third time</span> i got the book and here is it.<br /><br />I really really thank the Smashing Team for their efforts. Kudos to you guys n gals !<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com0tag:blogger.com,1999:blog-18125890.post-58859715169632082212010-09-30T19:19:00.012+05:302010-10-03T10:23:49.527+05:30Running Apache Traffic Server on Fedora 13<a href="http://trafficserver.apache.org/">Apache Traffic server</a> from <a href="http://developer.yahoo.com">Yahoo! Inc.</a> is really powerful, extensible web server which is <a href="http://en.wikipedia.org/wiki/Traffic_Server"> proved to serve 75K reqs/sec</a> on commodity hardware.<br /><br />In this post, you'll learn how to download and run the <a href="http://trafficserver.apache.org/">Traffic server</a> on your desktop, notebook.<br /><br /><br />1. Download <a href="http://trafficserver.apache.org/">TrafficServer</a> 2.0.1 (latest as of 30-Sep-2010)<br /><br /><a href="http://trafficserver.apache.org/downloads.html">http://trafficserver.apache.org/downloads.html</a><br /><br />2. Install the following packages <br /><br /><pre><br /><br />[nareshv@fallenangel ~]$ sudo yum install autoconf automake \ <br /> libtool gcc-c++ glibc-devel \<br /> openssl-devel tcl-devel \<br /> expat-devel sqlite-devel \<br /> pcre-devel -y<br /><br /></pre><br /><br />3. Extract the <a href="http://trafficserver.apache.org/">trafficserver</a> and build it<br /><br /><pre><br /><br />[nareshv@fallenangel ~]$ tar jxf trafficserver-2.0.1.tar.bz2<br />[nareshv@fallenangel ~]$ cd trafficserver-2.0.1<br />[nareshv@fallenangel trafficserver-2.0.1]$ ./configure <br />[nareshv@fallenangel trafficserver-2.0.1]$ gmake<br />[nareshv@fallenangel trafficserver-2.0.1]$ sudo gmake install<br /><br /></pre><br /><br />Now, all the required files would be installed in <b>"/usr/local"</b> instead of Fedora's default <b>/usr</b>. Lets configure Traffic server to act as <b>ReverseProxy</b> for apache<br /><br />5. set servername of your proxy (so that it will come up in the HTTP headers)<br /><br /><pre><br /><br />[nareshv@fallenangel ~]$ sudo vim /usr/local/etc/trafficserver/records.config<br /><br /> # Change line 22 (it might vary) to put your hostname like shown below<br /> 22 #CONFIG proxy.config.proxy_name STRING <proxy_name><br /> 22 CONFIG proxy.config.proxy_name STRING <b>fallenangel</b><br /><br /></pre><br /><br /><br />6. Make the <a href="http://trafficserver.apache.org/">Traffic server</a> listen on port 80 by default<br /><br /><pre><br /><br />[nareshv@fallenangel ~]$ sudo vim /usr/local/etc/trafficserver/records.config<br /><br /># Change 8080 port to 80 like shown below<br />105 #CONFIG proxy.config.http.server_port INT <b>8080</b><br />105 CONFIG proxy.config.http.server_port INT <b>80</b><br /><br /></pre><br /><br />7. Make <a href="http://trafficserver.apache.org/">Traffic server</a> act as reverse proxy for <a href="http://httpd.apache.org/">apache</a><br /><br />You can add as many rules as you want. The configuration file is well defined<br /><br /><pre><br />[nareshv@fallenangel ~]$ sudo vim /usr/local/etc/trafficserver/remap.config<br /><br />124 <br />125 <b>map http://localhost:80/ http://localhost:8080/<br />126 map http://fallenangel:80/ http://localhost:8080/</b><br /><br /></pre><br /><br />8. configure apache to listen on port 8080<br /><br /><pre><br /><br />[nareshv@fallenangel ~]$ sudo vim /etc/httpd/conf/httpd.conf<br /># Change it from default port 80 to 8080<br />#Listen <b>80</b><br />Listen <b>8080</b><br /><br /></pre><br /><br />9. Restart <a href="http://httpd.apache.org/">apache</a><br /><br /><pre><br /><br />[nareshv@fallenangel ~]$ sudo /etc/init.d/httpd restart<br /><br /></pre><br /><br />10. Restart <a href="http://trafficserver.apache.org/">traffic server</a><br /><br /><pre><br /><br />[nareshv@fallenangel ~]$ sudo /usr/local/bin/trafficserver restart<br />Stopping traffic_cop: [ OK ]<br />Stopping traffic_manager: [ OK ]<br />Stopping traffic_server: [ OK ]<br />Starting Apache Traffic Server: [ OK ]<br /><br /></pre><br /><br />11. Make simple request to your <a href="http://trafficserver.apache.org/">TrafficServer</a> to test if everything is ok<br /><br /><pre><br /><br />[nareshv@fallenangel ~]$ ~]$ curl -v http://localhost/<br />* About to connect() to localhost port 80 (#0)<br />* Trying ::1... Connection refused<br />* Trying 127.0.0.1... connected<br />* Connected to localhost (127.0.0.1) port 80 (#0)<br />> GET / HTTP/1.1<br />> 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<br />> Host: localhost<br />> Accept: */*<br />> <br />< HTTP/1.1 404 Not Found<br />< Date: Thu, 30 Sep 2010 09:47:53 GMT<br />< Server: ATS/2.0.1<br />< Content-Type: text/html; charset=iso-8859-1<br />< Age: 0<br />< Transfer-Encoding: chunked<br />< Connection: keep-alive<br />< Via: HTTP/1.1 fallenangel (ApacheTrafficServer/2.0.1 [cMs f ])<br />< <br /><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><br /><html><head><br /><title>404 Not Found</title><br /></head><body><br /><h1>Not Found</h1><br /><p>The requested URL / was not found on this server.</p><br /><hr><br /><address>Apache/2.2.16 (Fedora) Server at localhost Port 8080</address><br /></body></html><br />* Connection #0 to host localhost left intact<br />* Closing connection #0<br /><br /></pre><div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com2tag:blogger.com,1999:blog-18125890.post-68156561521047201052010-09-25T19:21:00.007+05:302010-09-25T19:32:36.904+05:3064-bit Flash Plugin on Fedora-13 running Firefox 4Firefox 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<br /><br />1. Go to our mozilla plugins directory<br /><br /><pre><br />[nareshv@fallenangel plugins]$ cd ~/.mozilla/plugins<br />[nareshv@fallenangel plugins]$ pwd<br />/home/nareshv/.mozilla/plugins<br /><br /></pre><br /><br />2. Download the latest flash plugin from the following url http://labs.adobe.com/downloads/flashplayer10.html and follow these steps<br /><br />Latest download link is <a href="http://download.macromedia.com/pub/labs/flashplayer10/flashplayer_square_p1_64bit_linux_091510.tar.gz">here</a>.<br /><pre><br />[nareshv@fallenangel plugins]$ wget 'http://download.macromedia.com/pub/labs/flashplayer10/flashplayer_square_p1_64bit_linux_091510.tar.gz'<br />--2010-09-25 19:16:17-- http://download.macromedia.com/pub/labs/flashplayer10/flashplayer_square_p1_64bit_linux_091510.tar.gz<br />Resolving download.macromedia.com... 69.192.35.191<br />Connecting to download.macromedia.com|69.192.35.191|:80... connected.<br />HTTP request sent, awaiting response... 200 OK<br />Length: 4308402 (4.1M) [application/x-gzip]<br />Saving to: “flashplayer_square_p1_64bit_linux_091510.tar.gz”<br /><br />100%[========================================================================================================================================>] 4,308,402 506K/s in 13s <br /><br />2010-09-25 19:16:31 (332 KB/s) - “flashplayer_square_p1_64bit_linux_091510.tar.gz” saved [4308402/4308402]<br /><br />[nareshv@fallenangel plugins]$ tar zxf flashplayer_square_p1_64bit_linux_091510.tar.gz <br />[nareshv@fallenangel plugins]$ ls<br />flashplayer_square_p1_64bit_linux_091510.tar.gz libflashplayer.so libflashplayer.so.old<br />[nareshv@fallenangel plugins]$ ls -l libflashplayer.so<br />-rw-rw-r--. 1 envy envy 10601968 Sep 4 04:47 libflashplayer.so<br /><br /></pre><br /><br />3. open http://www.youtube.com and see the flash player in action<br /><br /><img style="width:85%;height:85%" src="http://1.bp.blogspot.com/_3TgH8gNdnfc/TJ3_0S_ov2I/AAAAAAAAACY/mZkL0yXDL8c/s1600/flash.png" /><br /><br />4. Have fun with the new flash player.<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com0tag:blogger.com,1999:blog-18125890.post-77354554180591867892009-06-11T19:02:00.007+05:302009-06-24T12:58:30.858+05:30Fedora 11 64-bit Final on Macbook Pro 4,1<h2> Installation Process </h2><br /><br /><h3> 1. Touchpad </h3><br /><br />Touchpad doesn't work as usual during installation. Connect a USB mouse and things should be ok.<br /><br /><h3> 2. Install </h3><br /><br />Burn the DVD from http://fedoraproject.org and install OS as usual. If you need some help regarding the partitioning refer to <a href="http://nareshv.blogspot.com/2008/09/fedora-9-on-macbook-pro-penryn-intel.html">this post</a><br /><br /><h2> Post Install Process </h2><br /><br /><br /><h3> 1. BootDisk error </h3><br /><br /><b>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.<br /><br />In order to fix this error, you need follow these steps<br /><br /><ol><br /><li>Reboot your system<br /><li>Go to the 'refit' menu<br /><li>Choose the second icon from the left (Partitioning tool)<br /><li>If you see the 'refresh mbr', then do as requested<br /><li>Thats all! Now you should be able to boot correctly into Fedora<br /></ol><br /><br />Shutdown your macbook and reboot. Now everything should work as usual</b><br /><br /><br /><br /><h3>2. Wireless</h3><br /><br />You no longer need to install the ndiswrapper manually. Configure the 'livna' repository and install the ndiswrapper.<br /><br /><pre><br />bash$ sudo yum install ndiswrapper<br /></pre><br /><br />Download the drivers from <a href="ftp://ftp.hp.com/pub/softpaq/sp37501-38000/sp37950.exe">here</a>, and add them to the ndiswrapper<br /><br /><pre><br />bash$ cd /tmp/drivers<br />bash$ sudo ndiswrapper -i *.inf<br />bash$ sudo ndiswrapper -m<br />bash$ sudo ndiswrapper -mi<br />bash$ sudo ndiswrapper -ml<br /></pre><br /><br /><br /><h3>3. Touchpad/Tapping</h3><br /><br />Fedora 11 Automatically configures the touchpad driver using the bcm5974 driver present in the 2.6.29 kernel.<br /><br />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<br /><br /><pre><br /><br />nareshv@localhost $ cd /usr/share/hal/fdi/policy/20thirdparty<br />nareshv@localhost $ cp 10-synaptics.fdi 100-synaptics-custom.fdi<br /><br /></pre><br /><br />(Now edit 100-synaptics-custom.fdi, with the following contents)<br /><br /><pre><br />nareshv@localhost $ cat 100-synaptics-custom.fdi <br /><?xml version="1.0" encoding="ISO-8859-1"?><br /><br /><!-- DO NOT EDIT THIS FILE IN PLACE.<br /> This file will be overwritten with the next update. If you need to add<br /> custom options, copy the file into /etc/hal/fdi/policy/ first. <br /> <br /> See https://fedoraproject.org/wiki/Input_device_configuration --><br /><br /><deviceinfo version="0.2"><br /> <device><br /> <match key="info.capabilities" contains="input.touchpad"><br /> <!-- To add custom options for the touchpad, modify the examples below<br /> to suit your needs. The available options are listed in the<br /> "synaptics" man page. After modifyfing this file, you must<br /> restart HAL. Check the output of lshal whether your modifications<br /> have been merged successfully.<br /><br /> Note: <merge key="input.x11_options.s must always be type "string".<br /> The following examples enable left, right, middle clicks on<br /> single, double, triple finger tapping, respectively.<br /><br /> <merge key="input.x11_options.TapButton1" type="string">1</merge><br /> <merge key="input.x11_options.TapButton2" type="string">3</merge><br /> <merge key="input.x11_options.TapButton3" type="string">2</merge><br /> --><br /> <merge key="input.x11_driver" type="string">synaptics</merge><br /> <merge key="input.x11_options.LeftEdge" type="string">10</merge><br /> <merge key="input.x11_options.RightEdge" type="string">1200</merge><br /> <merge key="input.x11_options.TopEdge" type="string">10</merge><br /> <merge key="input.x11_options.BottomEdge" type="string">370</merge><br /> <merge key="input.x11_options.FingerLow" type="string">10</merge><br /> <merge key="input.x11_options.FingerHigh" type="string">20</merge><br /> <merge key="input.x11_options.MaxTapTime" type="string">180</merge><br /> <merge key="input.x11_options.MaxTapMove" type="string">220</merge><br /> <merge key="input.x11_options.SingleTapTimeout" type="string">100</merge><br /> <merge key="input.x11_options.MaxDoubleTapTime" type="string">180</merge><br /> <merge key="input.x11_options.LockedDrags" type="string">off</merge><br /> <merge key="input.x11_options.MinSpeed" type="string">1.10</merge><br /> <merge key="input.x11_options.MaxSpeed" type="string">1.30</merge><br /> <merge key="input.x11_options.AccelFactor" type="string">0.08</merge><br /> <merge key="input.x11_options.TapButton1" type="string">1</merge><br /> <merge key="input.x11_options.TapButton2" type="string">3</merge><br /> <merge key="input.x11_options.TapButton3" type="string">2</merge><br /> <merge key="input.x11_options.ClickFinger1" type="string">1</merge><br /> <merge key="input.x11_options.ClickFinger2" type="string">3</merge><br /> <merge key="input.x11_options.ClickFinger3" type="string">2</merge><br /> <merge key="input.x11_options.RTCornerButton" type="string">0</merge><br /> <merge key="input.x11_options.RBCornerButton" type="string">0</merge><br /> <merge key="input.x11_options.LTCornerButton" type="string">0</merge><br /> <merge key="input.x11_options.LBCornerButton" type="string">0</merge><br /> <merge key="input.x11_options.VertScrollDelta" type="string">20</merge><br /> <merge key="input.x11_options.HorizScrollDelta" type="string">50</merge><br /> <merge key="input.x11_options.HorizEdgeScroll" type="string">0</merge><br /> <merge key="input.x11_options.VertEdgeScroll" type="string">0</merge><br /> <merge key="input.x11_options.VertTwoFingerScroll" type="string">1</merge><br /> <merge key="input.x11_options.HorizTwoFingerScroll" type="string">1</merge><br /> </match><br /> </device><br /></deviceinfo><br /></pre><br /><br /><b>NOTE:</b> If you want to adjust the tapping, speed of mouse scroll, do these things<br /><br /><pre><br /><br />nareshv@localhost $ sudo yum install gsynaptics<br /><br /></pre><br /><br />Make your changes. and run the following command to see the latest changes. Now use the below keywords and update the above .fdi file.<br /><br /><pre><br /><br />nareshv@localhost $ synclient -l<br />Parameter settings:<br /> LeftEdge = 10<br /> RightEdge = 1200<br /> TopEdge = 10<br /> BottomEdge = 370<br /> FingerLow = 10<br /> FingerHigh = 20<br /> FingerPress = 256<br /> MaxTapTime = 180<br /> MaxTapMove = 220<br /> MaxDoubleTapTime = 180<br /> SingleTapTimeout = 100<br /> ClickTime = 100<br /> FastTaps = 0<br /> EmulateMidButtonTime = 75<br /> EmulateTwoFingerMinZ = 282<br /> EmulateTwoFingerMinW = 7<br /> VertScrollDelta = 20<br /> HorizScrollDelta = 50<br /> VertEdgeScroll = 0<br /> HorizEdgeScroll = 0<br /> CornerCoasting = 0<br /> VertTwoFingerScroll = 1<br /> HorizTwoFingerScroll = 0<br /> MinSpeed = 1.1<br /> MaxSpeed = 0<br /> AccelFactor = 1.3<br /> TrackstickSpeed = 0<br /> EdgeMotionMinZ = 30<br /> EdgeMotionMaxZ = 160<br /> EdgeMotionMinSpeed = 1<br /> EdgeMotionMaxSpeed = 120<br /> EdgeMotionUseAlways = 0<br /> UpDownScrolling = 1<br /> LeftRightScrolling = 1<br /> UpDownScrollRepeat = 1<br /> LeftRightScrollRepeat = 1<br /> ScrollButtonRepeat = 100<br /> TouchpadOff = 0<br /> GuestMouseOff = 0<br /> LockedDrags = 0<br /> LockedDragTimeout = 5000<br /> RTCornerButton = 0<br /> RBCornerButton = 0<br /> LTCornerButton = 0<br /> LBCornerButton = 0<br /> TapButton1 = 0<br /> TapButton2 = 0<br /> TapButton3 = 0<br /> ClickFinger1 = 1<br /> ClickFinger2 = 3<br /> ClickFinger3 = 2<br /> CircularScrolling = 0<br /> CircScrollDelta = 0.1<br /> CircScrollTrigger = 0<br /> CircularPad = 0<br /> PalmDetect = 0<br /> PalmMinWidth = 10<br /> PalmMinZ = 200<br /> CoastingSpeed = 0<br /> PressureMotionMinZ = 30<br /> PressureMotionMaxZ = 160<br /> PressureMotionMinFactor = 1<br /> PressureMotionMaxFactor = 0<br /> GrabEventDevice = 1<br /></pre><br /><br /><br /><br /><h3>4. Audio</h3><br /><br />Somehow the audio doesn't work out of the box, you need to set the model option<br /><br /><pre><br />bash$ echo "options snd_hda_intel model=mbp3" >> /etc/modprobe.d/sound<br /></pre><br /><br /><h3>5. Bluetooth</h3><br /><br />Works out of the box<br /><br /><h3>6. Firewire</h3><br /><br />Haven't tested (Don't have a device to check)<br /><br /><h3>7. Microphone</h3><br /><br />Haven't tested<br /><br /><h3>8. Network Card</h3><br /><br />Works out of the box<br /><br /><h3>9. Nvidia Graphics card</h3><br /><br />Works out of the box, using "nouveau" driver.<br /><br /><h3>10. Keyboard special keys / Backlight </h3><br /><br />works out of the box.<br /><br /><br /><h3>11. isight (webcam)</h3><br /><br />Works out of the box.<br /><br /><h3>12. Sensors </h3><br /><br />Works out of the box.<br /><br /><pre><br />nareshv@localhost $ sensors<br />applesmc-isa-0300<br />Adapter: ISA adapter<br />Left side :1996 RPM (min = 2000 RPM)<br />Right side :1999 RPM (min = 2000 RPM)<br />temp1: +32.2°C <br />temp2: +43.2°C <br />temp3: +42.0°C <br />temp4: +52.5°C <br />temp5: +43.0°C <br />temp6: +70.0°C <br />temp7: +51.5°C <br />temp8: +42.8°C <br />temp9: +36.8°C <br />temp10: +37.0°C <br />temp11: +37.8°C <br />temp12: +34.0°C <br /></pre><br /><br /><h3> 14. Suspend , Resume </h3><br /><br />Fedora 11 still has this suspend resume bug. Upon resume we will get this error from dmesg and the mouse will be stuck<br /><br /><pre><br />nareshv@ localhost $ | dmesg | tail -1<br />bcm5974: bad trackpad package, length: 8<br /></pre><br /><br />Fix is as described in my earlier post.<br /><br /><br /><br />(If you are running 32-bit Fedora 11 use /usr/lib instead of /usr/lib64)<br /><br /><pre><br />nareshv@nareshv «sr/lib64/pm-utils/sleep.d $ ls -l<br />total 64<br />-rwxr-xr-x. 1 root root 2490 2009-04-24 15:21 00auto-quirk*<br />-rwxr-xr-x. 1 root root 274 2009-04-24 15:21 00logging*<br />-rwxr-xr-x. 1 root root 203 2009-04-24 15:21 00powersave*<br />-rwxr-xr-x. 1 root root 809 2009-04-24 15:21 01grub*<br />-rwxr-xr-x. 1 root root 664 2009-04-24 15:21 49bluetooth*<br />-rwxr-xr-x. 1 root root 991 2009-04-24 15:21 55NetworkManager*<br />-rwxr-xr-x. 1 root root 141 2009-02-26 19:25 56atd*<br />-rwxr-xr-x. 1 root root 335 2009-04-24 15:21 75modules*<br />-rwxr-xr-x. 1 root root 455 2009-04-24 15:21 90clock*<br />-rwxr-xr-x. 1 root root 1098 2009-04-24 15:21 94cpufreq*<br />-rwxr-xr-x. 1 root root 297 2009-04-24 15:21 95led*<br />-rwxr-xr-x. 1 root root 707 2009-04-24 14:57 95packagekit*<br />-rwxr-xr-x. 1 root root 2269 2009-04-24 15:21 98smart-kernel-video*<br />-rwxr-xr-x. 1 root root 2068 2009-04-24 15:21 99hd-apm-restore.hook*<br />-rwxr-xr-x. 1 root root 5685 2009-04-24 15:21 99video*<br /><br />[nareshv@nareshv ~]$ cat /usr/lib64/pm-utils/sleep.d/02touchpad<br />#!/bin/bash<br /><br />if [ -e '/usr/lib64/pm-utils/functions' ];then<br />. /usr/lib64/pm-utils/functions<br />fi<br /><br />suspend_bcm5974() { /sbin/rmmod bcm5974; }<br />resume_bcm5974() { /sbin/modprobe bcm5974; }<br /><br />case "$1" in<br /> suspend|hibernate)<br /> suspend_bcm5974;<br /> ;;<br /> thaw|resume)<br /> resume_bcm5974;<br /> ;;<br /> *)<br /> ;;<br />esac<br /><br />exit $?<br /><br /></pre><div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com3tag:blogger.com,1999:blog-18125890.post-35979959152537663492009-02-07T10:09:00.003+05:302009-02-07T10:34:40.593+05:30Fedora 11 Alpha 64-bit on Macbook Pro 4,1Yesterday Fedora has Released 'Alpha' version of its upcoming Operating System code named 'Leonidas' (Version 11).<br /><br />Though i already have Fedora 11 from rawhide, i had installed the Alpha version from the DVD.<br /><br />NOTE: Pre-Final releases are not recommended for daily usage, be warned.<br /><br /><h2>Installation Process</h2><br /><br /><h3> Touchpad </h3><br /><br />During installation you notice that the 'touchpad' doesn't work. You need to plug in a USB Mouse and proceed with the installation<br /><br />The whole installation process worked seamlessly<br /><br /><h2>Post Installation</h2><br /><br /><h3>Audio</h3><br /><br />This still isn't being detected correctly, i had to follow my earlier hack to get this working<br /><br />create the following file.<br /><pre><br /> nareshv@nareshv:~ $ cat /etc/modprobe.d/audio<br />options snd_hda_intel model=mbp3<br /></pre><br /><br /><h3>2. Ndiswrapper 1.54 version</h3><br /><br />There seem to be some problem with the 'rpmfusion' repository, so i had to compile ndiswrapper 1.54 myself. During the compilation you might see errors like this<br /><br /><pre><br /> nareshv@nareshv:/tmp/ndiswrapper-1.54 $ gmake<br />make -C driver<br />make[1]: Entering directory `/tmp/ndiswrapper-1.54/driver'<br />make -C /usr/src/kernels/2.6.29-0.66.rc3.fc11.x86_64 M=/tmp/ndiswrapper-1.54/driver<br />make[2]: Entering directory `/usr/src/kernels/2.6.29-0.66.rc3.fc11.x86_64'<br /> LD /tmp/ndiswrapper-1.54/driver/built-in.o<br /> MKEXPORT /tmp/ndiswrapper-1.54/driver/crt_exports.h<br /> CC [M] /tmp/ndiswrapper-1.54/driver/crt.o<br /> MKEXPORT /tmp/ndiswrapper-1.54/driver/hal_exports.h<br /> CC [M] /tmp/ndiswrapper-1.54/driver/hal.o<br /> CC [M] /tmp/ndiswrapper-1.54/driver/iw_ndis.o<br /> CC [M] /tmp/ndiswrapper-1.54/driver/loader.o<br /> MKEXPORT /tmp/ndiswrapper-1.54/driver/ndis_exports.h<br /> CC [M] /tmp/ndiswrapper-1.54/driver/ndis.o<br />/tmp/ndiswrapper-1.54/driver/ndis.c: In function ‘NdisSystemProcessorCount’:<br />/tmp/ndiswrapper-1.54/driver/ndis.c:2627: warning: overflow in implicit constant conversion<br /> MKEXPORT /tmp/ndiswrapper-1.54/driver/ntoskernel_exports.h<br /> CC [M] /tmp/ndiswrapper-1.54/driver/ntoskernel.o<br /> MKEXPORT /tmp/ndiswrapper-1.54/driver/ntoskernel_io_exports.h<br /> CC [M] /tmp/ndiswrapper-1.54/driver/ntoskernel_io.o<br /> CC [M] /tmp/ndiswrapper-1.54/driver/pe_linker.o<br /> CC [M] /tmp/ndiswrapper-1.54/driver/pnp.o<br /> CC [M] /tmp/ndiswrapper-1.54/driver/proc.o<br /> MKEXPORT /tmp/ndiswrapper-1.54/driver/rtl_exports.h<br /> CC [M] /tmp/ndiswrapper-1.54/driver/rtl.o<br /> CC [M] /tmp/ndiswrapper-1.54/driver/wrapmem.o<br /> CC [M] /tmp/ndiswrapper-1.54/driver/wrapndis.o<br />/tmp/ndiswrapper-1.54/driver/wrapndis.c:1747:3: error: invalid preprocessing directive #.<br />make[3]: *** [/tmp/ndiswrapper-1.54/driver/wrapndis.o] Error 1<br />make[2]: *** [_module_/tmp/ndiswrapper-1.54/driver] Error 2<br />make[2]: Leaving directory `/usr/src/kernels/2.6.29-0.66.rc3.fc11.x86_64'<br />make[1]: *** [modules] Error 2<br />make[1]: Leaving directory `/tmp/ndiswrapper-1.54/driver'<br />gmake: *** [all] Error 2<br /> nareshv@nareshv:/tmp/ndiswrapper-1.54 $<br /></pre><br /><br />In order to get rid of that error, i had done a minor hack.<br /><br /><pre><br /> nareshv@nareshv:/tmp/ndiswrapper-1.54 $ vim driver/wrapndis.c<br /><br />1744 >___.ndo_set_mac_address = ndis_set_mac_address,<br />1745 >___.ndo_get_stats = ndis_get_stats,<br />1746 /*#ifdef CONFIG_NET_POLL_CONTROLLER<br />1747 >___.poll_controller = ndis_poll_controller;<br />1748 #endif*/<br />1749 };<br />1750 #endif<br /><br /></pre><br /><br />Just comment the lines from 1746 to 1748. The compilation will work just fine.<br /><br /><h3>3. KDE-4.2</h3><br /><br />Kde-4.2 is included in the latest release, which is very good in terms of rendering, when compared to the earlier versions.<br /><br />You might still see some screen corruption in the system tray, which the kde team has yet to fix.<br /><br /><br /><h3>4. Pommed-1.25 for apple keyboard special keys</h3><br /><br />You need to install pommed-1.25 version, in order to run with 2.6.29 kernel<br /><br /><h3>Nvidia Drivers</h3><br /><br />You no longer need to do any hacks like -IgnoreABI in order to work with xorg-1.6, Nvidia driver 180.25 has support to work with latest xorg.<br /><br /><h2> Few Gotchas </h2><br /><br /><h3> sudo commands </h3><br /><br />You notice a big delay till the command is executed, when you run any sudo commands, not sure whats the problem here is.<br /><br /><h3> GDM and Preferred Desktop </h3><br /><br />No matter which desktop you choose, GDM tries to reset your preferred desktop to "GNOME". For me i was choosing KDE all the time, but whenever i reboot, the default desktop is getting reset to "GNOME"<br /><br />There are many other features which you can find at the <a href='https://fedoraproject.org/wiki/Fedora_11_Alpha_release_notes'>release notes</a><div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com1tag:blogger.com,1999:blog-18125890.post-75315946825476886332009-01-13T13:31:00.002+05:302009-01-13T13:49:41.254+05:30Fedora 11 (Leonidas) 64-bit - Rawhide - on Macbook Pro 4,1Fedora 11 is not out yet, its just in the rawhide repository. In order to upgrade from Fedora 10 to Fedora 11, you need to do it via yum.<br /><br /><h2> Pre Upgrade Steps </h2><br /><br />1. Enable the rawhide repository<br /><br /><pre><br />cat /etc/yum.repos.d/rawhide.repo<br /><br />[rawhide]<br />name=Fedora - Rawhide - Developmental packages for the next Fedora release<br />failovermethod=priority<br />#baseurl=http://download.fedoraproject.org/pub/fedora/linux/development/$basearch/os/<br />mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide&arch=$basearch<br />enabled=1<br />gpgcheck=0<br />gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test-$basearch file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch<br /><br /></pre><br /><br />2. Remove the python-2.5 packages as it will conflict with the python-2.6 on rawhide<br /><br /><pre><br />/bin/rpm -e fusion-icon-gtk compiz-gnome ccsm ekiga setroubleshoot setroubleshoot-server compizconfig-python fusion-desktop-effects fusion-icon fusion-icon setroubleshoot-plugins<br /></pre><br /><br />(Skip the missing ones, i had installed extra packages, so above command worked for me)<br /><br />3. Now do a yum update<br /><br /><pre><br />sudo yum update -y<br /></pre><br /><br /><h2> Post upgrade steps </h2><br /><br />After the installation is complete, you need to edit the following configuration files<br /><br />1. Update /boot/grub/grub.conf to allow the nvidia driver to be loaded on 2.6.29 kernel<br /><br /><pre><br />title Fedora (2.6.29-0.28.rc1.fc11.x86_64)<br /> root (hd0,2)<br /> kernel /vmlinuz-2.6.29-0.28.rc1.fc11.x86_64 ro root=UUID=25d9d23a-5a17-4ffe-831f-556213caaa16 rhgb quiet nopat<br /> initrd /initrd-2.6.29-0.28.rc1.fc11.x86_64.img<br /></pre><br /><br /><b>nopat</b> is the option which you should add.<br /><br />2. Current nvidia driver <a href="http://http://www.nvidia.com/object/linux_display_amd64_180.22.html">180.22</a>, doesn't work with the latest xorg that is being shipped with the Fedora 11.<br /><br />You will see an error in /var/log/Xorg.0.log if you fail to do this step<br /><br /><pre><br /><br />112 ================ WARNING WARNING WARNING WARNING ================<br />113 This server has a video driver ABI version of 5.0 that this<br />114 driver does not officially support. Please check<br />115 http://www.nvidia.com/ for driver updates or downgrade to an X<br />116 server with a supported driver ABI.<br />117 =================================================================<br />118 (EE) NVIDIA: Use the -ignoreABI option to override this check.<br />119 (II) UnloadModule: "nvidia"<br />120 (II) Unloading /usr/lib64/xorg/modules/drivers//nvidia_drv.so<br />121 (EE) Failed to load module "nvidia" (module requirement mismatch, 0)<br />122 (II) LoadModule: "synaptics"<br />123 (II) Reloading /usr/lib64/xorg/modules/input//synaptics_drv.so<br />124 (EE) No drivers available.<br />125 <br />126 Fatal server error:<br />127 no screens found<br /><br /></pre><br /><br />The fix is simple <a href="http://http://nareshv.blogspot.com/2008/04/fedora-9-rawhide-and-latest-nvidia-179.html">(which i had mentioned earlier for the older nvidia driver)</a><br /><br />a. Rename your current Xorg binary<br /><br /><pre><br />mv /usr/bin/Xorg /usr/bin/Xorg.0<br /></pre><br /><br />b. Create a blank Xorg file, make it executable<br /><br /><pre><br />touch /usr/bin/Xorg<br />chmod +x /usr/bin/Xorg <br /></pre><br /><br />c. Add the following lines<br /><br /><pre><br />vi /usr/bin/Xorg<br /><br />#!/bin/bash<br />exec /usr/bin/Xorg.0 -ignoreABI "$@"<br /></pre><br /><br /><br />3. Thats it, now restart your macbook, and boot into the newly installed Fedora 11 Rawhide (9.10)<br /><br /><pre><br />nareshv /etc/yum.repos.d $ cat /etc/issue<br />Fedora release 10.90 (Rawhide)<br />Kernel \r on an \m (\l)<br /></pre><br /><br /><br />I have just installed Fedora 11, so far seems promising, no crashes yet.<br /><br />Few notes<br /><br />Firefox version is bumped up to 3.1 by default<div class="blogger-post-footer">Feed for nareshv.blogspot.com</div>Nareshhttp://www.blogger.com/profile/18187716902126738230noreply@blogger.com0