Archive

Archive for the ‘Tips & Tricks’ Category

`gem_original_require’: no such file to load — zlib (LoadError)

January 28th, 2012 No comments

You may have faced a such a error, when trying to execute gem list :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- zlib (LoadError)
	from //lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from //lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:1
	from //lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from //lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from //lib/ruby/site_ruby/1.8/rubygems/commands/query_command.rb:3
	from //lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from //lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from //lib/ruby/site_ruby/1.8/rubygems/commands/list_command.rb:2
	from //lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from //lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from //lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:167:in `load_and_instantiate'
	from //lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:88:in `[]'
	from //lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:144:in `find_command'
	from //lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:131:in `process_args'
	from //lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:102:in `run'
	from //lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:58:in `run'
	from /bin/gem:21

To solve this issue, move to the zlib/ folder, it should be something like this /usr/src/ruby-1.8.6-pXXX/ext/zlib/

execute the extconf.rb :

1
root@xen1:/usr/src/ruby-1.8.6-p398/ext/zlib# ruby extconf.rb

If every things are ok, you should see:

1
2
3
4
checking for deflateReset() in -lz... yes
checking for zlib.h... yes
checking for kind of operating system... Unix
creating Makefile

compile and deploy zlib by runnning both commands:

1
2
sudo make 
sudo make install

Make sure gem command is woking:

1
gem list

You should see:

1
*** LOCAL GEMS ***
Categories: how-to, snippet, Tips & Tricks Tags: , , ,

How to recursively delete .svn directories

April 20th, 2011 No comments

Just move to the directory where you want to delete, recursively, the .svn directories and type the folowing line:

rm -rf `find  . -type d -name .svn`
Categories: how-to, snippet, Tips & Tricks Tags: , ,

Error: Failed to get the adb version: Cannot run program … on Ubuntu 10.04 (Lucid Lynx)

October 23rd, 2010 1 comment

I met the following error when trying to launch an Android project using eclipse:

[2010-10-23 19:31:02 - adb]Failed to get the adb version: Cannot run program "/usr/src/android-sdk-linux_x86/tools/adb": java.io.IOException: error=2, <a href="http://www.score-louisville.org/content/view/31/">cialis effectiveness</a> No such file or directory

After googling I found those useful steps to make it running properly:

1. install getlibs from http://frozenfox.freehostia.com/cappy/getlibs-all.deb

2. open terminal and go to your android folder and then platforms/android-1.6/tools

3. run this command from terminal getlibs aapt

Source: http://ubuntuforums.org/showthread.php?t=1317567

How to install Sun Java JRE / JDK on Ubuntu 10.04 (Lucid Lynx)

October 23rd, 2010 No comments

Copy and paste the following commands into your terminal:

1
2
3
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" 
sudo apt-get update 
sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin sun-java6-fonts

Verify your java version:

1
java -version

Done :)

Fatal error: Class ‘Net_SMTP’ not found in /usr/lib/php/Mail/smtp.php on line 349

August 2nd, 2010 No comments

Error:

1
2
3
Warning: include_once(Net/SMTP.php) [function.include-once]: failed to open stream: No such file or directory in /usr/lib/php/Mail/smtp.php on line 348 
Warning: include_once() [function.include]: Failed opening 'Net/SMTP.php' for inclusion (include_path='.:/usr/lib/php') in /usr/lib/php/Mail/smtp.php on line 348 
Fatal error: Class 'Net_SMTP' not found in /usr/lib/php/Mail/smtp.php on line 349

Solution:
All you need is to install the missing pear package:

1
sudo pear install Net_SMTP

Creating init.d script for Juggernaut

July 24th, 2010 No comments

The Juggernaut plugin for Ruby on Rails aims to revolutionize your Rails app by letting the server initiate a connection and push data to the client. In other words your app can have a real time connection to the server with the advantage of instant updates. Although the obvious use of this is for chat, the most exciting prospect is collaborative cms and wikis.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh -e 
APP_PATH=/home/zooz.com/current 
JUGGERNAUT_CONFIG="$APP_PATH/juggernaut.yml" 
JUGGERNAUT_PID="$APP_PATH/tmp/pids/juggernaut.pid" 
JUGGERNAUT_LOG="$APP_PATH/log/juggernaut.log" 
RAILS_ENV=production 
case $1 in 
        start) 
                echo "Starting Juggernaut ..." 
                juggernaut -d -c $JUGGERNAUT_CONFIG --pid $JUGGERNAUT_PID --log $JUGGERNAUT_LOG 
        ;; 
        stop) 
                echo "Stopping Juggernaut ..." 
                juggernaut -k * -c $JUGGERNAUT_CONFIG --pid $JUGGERNAUT_PID --log $JUGGERNAUT_LOG 
        ;; 
        restart) 
                echo "Juggernaut restart ..." 
                echo "Stopping Juggernaut ..." 
                juggernaut -k * -c $JUGGERNAUT_CONFIG --pid $JUGGERNAUT_PID --log $JUGGERNAUT_LOG 
                echo "Starting Juggernaut ..." 
                juggernaut -d -c $JUGGERNAUT_CONFIG --pid $JUGGERNAUT_PID --log $JUGGERNAUT_LOG 
        ;; 
esac

[Novice] Linux File Structure

September 13th, 2009 No comments
Linux File Structure

Linux File Structure

You may find it useful :

Categories: Tips & Tricks Tags: ,

ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: NO)

July 27th, 2009 4 comments

Today I got the error below :

1
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

after typing :

1
mysql -u root

I don’t know why ? but I know how to solve it.
First of all let’s disable password authentication :
Stop your MySQL daemon:

1
/etc/init.d/mysql stop

or

1
/etc/init.d/mysqld stop

Then run the following command line in background :

1
mysqld_safe --skip-grant-tables &

Secondly run :

1
mysql -u root

Finally, In your MySQL command line prompt issue the following command:

1
2
3
4
USE mysql;
UPDATE user SET password=PASSWORD("my_password") WHERE user="root";
FLUSH PRIVILEGES;
EXIT

Password is now reset to my_password. So just restart your MySQL server using :

1
/etc/init.d/mysql restart

or

1
/etc/init.d/mysqld restart

and use your new password to authenticate :

1
mysql -u root -p

All that remains is to enter your password.

Categories: how-to, Tips & Tricks Tags: ,

GTalk: Text Formatting; bold, italic and strikethrough.

July 21st, 2009 2 comments

To have more fun with GTalk (Google Talk) you can add some text formatting :
Gtalk

  • to make it bold, simply use * * (asterisk) between the text that intended to be bold in font style : i.e. *marouan* is rendred as marouan.
  • to make it italic, simply use _ _ (underscore) between the text that intended to be italic in font style: i.e. _marouan_ is rendred as marouan.
  • to make it strikethrough, simply use – - (dash) between the text that intended to be strikethrough in font style: i.e. -marouan- is rendred as marouan.

This is a stupid post but if you are addicted to Google Talk, like me, you will have more fun with GTalk using those few styling tips.

ERROR: ‘phpize’ failed on ubuntu

June 24th, 2009 No comments

Today when I tried to install a pear package using the pecl command line on ubuntu, I got the following error :

1
2
3
4
5
6
7
8
pecl install pecl_http
downloading pecl_http-1.6.3.tgz ...
Starting to download pecl_http-1.6.3.tgz (173,005 bytes)
.....................done: 173,005 bytes
71 source files, building
running: phpize
sh: phpize: not found
ERROR: `phpize' failed

Solution :
Just install php5-dev package

1
apt-get install php5-dev

or php4-dev if you are running php 4.x

1
apt-get install php4-dev
Categories: how-to, Tips & Tricks Tags: , , , ,