Posts

Showing posts from June, 2008

Debugging PHP in Quanta Using xdebug

Image
Quanta is a full featured KDE programming editor. Quanta now has support for DBGp debugging protocol. Install quanta by by issuing following command. sudo apt-get -y install quanta Configuring xdebug Install xdebug using previous blog post on Debugging PHP using xdebug . After installing xdebug add following configuration options to your /etc/php5/apache2/php.ini . xdebug.remote_enable = 1 xdebug.remote_handler = dbgp xdebug.remote_mode = req xdebug.remote_port = 9000 xdebug.remote_host = localhost Now restart your apache using following command. sudo /etc/init.d/apache2 restart Configuring quanta You can debug php scripts only in projects. Create a new project in quanta and add /var/www to it. Open project properties, select DBGp from Debugger combo box and accept remaining default settings. If you followed previous steps and debugging on local machine then you don't have to do anything else. If you have to change debug port and server url then click on Options

Generate "lorem ipsum" in unlimited quantity

Image
Lorem Ipsum generator is a an application hosted on Google code. It generates lots of dummy text that can be used to fill your GUI designs and web page mockups. This text is particularly useful in designing gui with out any distraction. Installation Get lorem ipsum generator deb package from following link http://code.google.com/p/lorem-ipsum-generator/ Now click on downloaded to deb package to install it in GUI way. Usage Just launch the application using the command lorem-ipsum-generator . After launching your application you will be presented with options to generate either Paragraphs or Sentences with specified quantity. Later you can copy generated text to clipboard and use it in your application design.

How to setup lighter, faster & minimal Ubuntu

Image
There are many variants of Ubuntu. One of them is Ubuntu JeOS where JeOS stands for Just enough Operating System . JeOS is a lean version of Ubuntu server and optimized for running in virtual machines like VMWare. But it can also be used to setup your own Ubuntu that matches your taste without extra luggage. I will get you started by showing you how to setup minimal GUI. Later you can make customizations by installing applications that you like. So lets get started. Download Ubuntu JeOS Download Ubuntu JeOS iso image from following url and install it either in VMWare or VirtualBox. Download Ubuntu JeOS Installing GUI This part of guide can be used to install GUI on ubuntu server. First update your apt cache by issuing following command. sudo apt-get update You may install either xdm/gdm/kdm for login manager. Since xdm is lighter than others I prefer installing it. sudo apt-get -y install xdm Install core of gnome with out any extra baggage. sudo apt-get -y insta

phonetooth: Chat with mobile users

Image
phonetooth can be used to chat with mobile users and transfer files from ubuntu desktop system. Its written in python. phonetooth uses gammu as its backend and because of this reason it supports most of the phones from Samsung, SonyErricson, Nokia & Motorola. Installation Download sources from Google Code and unpack. Now execute following command to prepare build environment ./configure --prefix=/usr Now execute following command to install it. sudo make install

Circular Menu for Gnome

Image
There is a new circular menu project that is being hosted on Google code. This program runs in composite environment like compiz. Currently there is no package for this application you have to compile and run it from command line. You can navigate this application by using keyboard keys PageUp, PageDown,Home & End keys. Visit Circular application menu project.

Guide to Faster Ubuntu

Optimize ubuntu boot sequence by profiling it While you are in grub menu highlight your preferred kernel version and press "e" . Highlight the line beginning with kernel and press "e" again. Press End key in order to goto end of that line. Add a word "profile" without quotes to that line and press Enter . Now press "b" to continue booting. This one time special boot may take more time than ordinary boot. But during this boot ubuntu monitors file usage and preloads those files during subsequent boots. prelink Any executable that makes heavy use of shared libraries can benefit from prelinking. Prelinking resolves addresses of shared libraries in advance this reduces number of relocations. Prelink is also useful in the context of security since we can tell prelink to make libraries load at random addresses until next run of prelink. This is useful since libraries won't load at fixed addresses on every system. You can install pre

Use Flickr Images as Ubuntu Wallpapers

Image
webilder is a convenient little application that downloads and sets flickr photos as your desktop wallpapers. webilder no longer provides repository sources for either gutsy or hardy. But getdeb provides Debian packages for both gutsy and hardy including 32 & 64 bit architectures. Installation Goto http://www.getdeb.net/app/Webilder and download debian packages that correspond to your processor architecture & ubuntu version. Now install both webilder & webilder-gnome packages using following command. sudo dpkg -i webilder*.deb Usage Click on your gnome panel add choose +Add to Panel menu item. You will see list of gnome panel applets. Select Webilder Desktop Applet and drag and drop it on to gnome panel. Right click on webilder icon on gnome-panel and select Download Photos . webilder by default downloads interestingness photos from flickr. These interestingness photos are usually high quality photos tagged by flickr community. Beware that these photos some t

fusion-icon - Tray Icon to Manage to Manage Compiz

Image
fusion-icon is a nice little applicaion that sits in system tray and provides GUI means of doing compiz common operations. With fusion-icon you can easily do following things without touching terminal. You can launch compiz settings manager & emerald theme manager. Reload or select a new window manager. Allows you to choose either gtk window decorator(metacity) or emerald. Execute following command to install fusion-icon . sudo apt-get -y install fusion-icon And add fusion-icon command to your sessions.

Profiling PHP Using xdebug & kcachegrind

See the blogpost on xdebug installation before continuing. Enable Proiling You need to add following line to /etc/php5/apache2/php.ini to enable profiling of php scripts. xdebug.profiler_enable=1 Now restart the apache server by issuing following command. sudo apache2ctl restart When ever you access a php page through apache, xdebug will create a file something like cachegrind.out.15093 . xdebug by default uses /tmp directory to dump files which contain profiling information. You can change this target directory by using xdebug option xdebug.profiler_output_dir and you can change result file name by using the option xdebug.profiler_output_name . See more xdebug profiling options . Some times you don't want to profile all requests. xdebug provides a selective mechanism to trigger profiling of specific requests. In order to enable this option you have to add following configuration option to php.ini . xdebug.profiler_enable_trigger=On Now you can trigger profilin

Debugging PHP Using xdebug

Image
xdebug is an open source debugger available for PHP. xdebug can be used to display more information in error traces. It can also be used to collect detailed code coverage & profiling information. Installation You need to install following packages to prepare environment for installation of pecl module xdebug. sudo apt-get -y install php-pear php5-dev build-essential Now we install xdebug using pecl. sudo pecl install xdebug Above command will download, compile & install xdebug on your system. Configuration Open /etc/php5/apache2/php.ini and append following line. zend_extension=/usr/lib/php5/20060613/xdebug.so Be careful about that number part in the path as it could be different for you. Now restart apache by issuing following command. sudo apache2ctl restart Now try to view the output of your phpinfo() function. If you find xdebug word in that then it means you have successfully installed xdebug. Stacktrace xdebug.collect_params accepts values fr

Installing LAMP Server Stack.

Apache Apache is a free & widely used web server. To install it on your local system execute following command. sudo apt-get -y install apache2 You might get following warning when starting apache web server. apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName Add following line to /etc/apache2/apache2.conf to slience the warning. ServerName localhost To test the installation enter http://localhost in addressbar of your browser and you should see the message It works! . Visit Apache HTTP Server site. PHP PHP is one of the most easiest scripting language available for quickly writing backend code. Install php by executing following command. sudo apt-get -y install php5 libapache2-mod-php5 By default you will not be able to save anything to /var/www. To make /var/www writable execute following command. sudo chmod -R 755 /var/www/ To test php installation enter following snippet into /var/www/he

How to enable kerning in Firefox 3 ?

If you don't know about kerning please visit wikipedia article on kerning . Kerning deals with space adjustments between letters to make words more readable. Now a days most of the fonts are shipped with kern hinting but very few applications make use of this extra information. Firefox 3 now officially supports kerning for text elements. Please make sure you only apply kerning to the elements which use larger font sizes because you won't observe much difference with smaller ones. And use kerning carefully as it could slowdown page rendering because of extra math calculations. With Firefox 3 you can use the css property text-rendering to enable or disable kerning. text-rendering takes following 4 possible values. auto - If the font size is less than 20px then Firefox uses fast text rendering method provided by operating system otherwise it enables both ligatures and kerning. optimizeSpeed - will disable font kerning. optimizeLegibility - this option enables both

List of Popular PPA Repositories

Mozilla deb http://ppa.launchpad.net/mozillateam/ubuntu intrepid main deb-src http://ppa.launchpad.net/mozillateam/ubuntu intrepid main Google Gadgets deb http://ppa.launchpad.net/googlegadgets/ubuntu hardy main deb-src http://ppa.launchpad.net/googlegadgets/ubuntu hardy main Ubuntu Netbook Remix deb http://ppa.launchpad.net/netbook-remix-team/ubuntu hardy main deb-src http://ppa.launchpad.net/netbook-remix-team/ubuntu hardy main Banshee Team deb http://ppa.launchpad.net/banshee-team/ubuntu hardy main deb-src http://ppa.launchpad.net/banshee-team/ubuntu hardy main Ubuntu Backporters deb http://ppa.launchpad.net/ubuntu-backporters/ubuntu hardy main deb-src http://ppa.launchpad.net/ubuntu-backporters/ubuntu hardy main Mythbuntu deb http://ppa.launchpad.net/mythbuntu/ubuntu hardy main deb-src http://ppa.launchpad.net/mythbuntu/ubuntu hardy main KDE4 deb http://ppa.launchpad.net/kubuntu-members-kde4/ubuntu hardy main deb-src http://ppa.launchpad.net/kubuntu-member

TimeVault - Backup your files

Image
TimeVault is a little python application that runs on Linux. timevault is mainly used to create snapshots of the files on your system, here a snapshot is close to restore point on windows xp. And only super user can delete these incremental snapshots to conserve space on disk. The beauty of this system is timevault uses links to take backup of these files and linux filesystem won't delete these files until link count reaches to zero. SQLite is used to store meta information of snapshot. This application nicely integrates with nautilus so that you can see snapshot properties from within nautilus. Color coding is used to easily understand snapshot status. TimeVault uses filesystem watches for changes so when ever you change or delete files they will be automatically backed up. You can download timevault deb binaries from launchpad. Download timevault binaries.

Autostart Emerald

Image
People who are using compiz have two ways to automatically start emerald upon login. Using Sessions This method involves adding following command to sessions. emerald --replace & Using compiz-decorator This method involves changing a line inside the file /usr/bin/compiz-decorator from USE_EMERALD="no" to USE_EMERALD="yes"

Speedup rdesktop

rdesktop is used to login into windows machines from linux/unix machines. By default rdesktop won't enable caching. Because of this default behavior rdesktop fetches portions of the screen that weren't updated at all. This is particularly painful if your target machine is geographically situated somewhere else. You just have to add two flags -P -z to your rdekstop command to enable local disk based caching and compression of transmission. rdesktop -P -z [target machine ip] I have no clue why this option was not enabled by default since it consumes very little disk space.

apt-get Easter Egg

Execute following command to see the easter egg. apt-get moo Enjoy ubuntu. :)

Open new firefox tab in background

Image
There are situations where you don't want a new tab to take focus in Firefox. Its been pain since you don't find any option under Firefox preferences to change this behavior. Now there is a fix and you can force new tabs to open in background. Start your firefox browser, enter about:config in address bar and search for following key. browser.tabs.loadDivertedInBackground Now change this key to true by double clicking on it. If the above entry doesn't exist then create a new boolean key with above name and set it to true. Enjoy Firefox. :)

NewWave - Intrepid Ibex Theme

Image
Ubuntu art team is working on look & feel of next ubuntu release Intrepid Ibex. The theme pack is called New Wave which is still in alpha stage but looks cool. This theme pack contains gtk, metacity, emerald, compiz-fusion elements. Give it a try on existing ubuntu installations and let ubuntu art team know what you think about it. Download " New wave theme pack ".

Install Different Types of Servers

According to ubuntu help section, tasksel is a command line application that can be used to install tasks. Here a task is nothing but meta package for other packages. Except that you can define your own tasks by editing the file /usr/share/tasksel/ubuntu-tasks.desc . Tasksel presents curses based interface by default if you don't specify any command line arguments. Following are some of the predefined tasks you can install. dns-server edubuntu-server lamp-server ubuntu-desktop ubuntu-live mail-server openssh-server print-server samba-server myubuntu-desktop ubuntustudio-desktop You can get complete list of tasks by executing following command. tasksel --list-tasks Here is the command to install any given task. sudo tasksel install [task name] Enjoy ubuntu :)

Speedup SSH Authentication

Did you wait like 10 seconds to ssh into another machine which is just within one feet ?, Well the problem seems to be ssh authentication requires a time consuming DNS lookup. Fix for this problem is to disable DNS lookup during authentication. Follow steps below to fix this. Open up the file /etc/ssh/sshd_config file as root user and append the following line to it. UseDNS no Save the file and exit the editor.Now restart ssh service by executing following command. sudo /etc/init.d/ssh restart From now on your ssh logins should work like a breeze.