Showing posts from June, 2008

Debugging PHP in Quanta Using xdebug

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 quantaConfiguring xdebugInstall 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 = localhostNow restart your apache using following command.sudo /etc/init.d/apache2 restartConfiguring quantaYou 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 button and change those set…

Generate "lorem ipsum" in unlimited quantity

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.InstallationGet lorem ipsum generator deb package from following link click on downloaded to deb package to install it in GUI way.UsageJust 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

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 JeOSDownload Ubuntu JeOS iso image from following url and install it either in VMWare or VirtualBox.Download Ubuntu JeOSInstalling GUIThis part of guide can be used to install GUI on ubuntu server. First update your apt cache by issuing following command.sudo apt-get updateYou may install either xdm/gdm/kdm for login manager. Since xdm is lighter than others I prefer installing it.sudo apt-get -y install xdmInstall core of gnome with out any extra baggage.sudo apt-get -y install gnome-coreInstall xorg since …

phonetooth: Chat with mobile users

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.InstallationDownload sources from Google Code and unpack. Now execute following command to prepare build environment./configure --prefix=/usrNow execute following command to install it.sudo make install

Circular Menu for Gnome

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 itWhile 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.prelinkAny 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 prelink by issuing followi…

Use Flickr Images as Ubuntu Wallpapers

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.InstallationGoto 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*.debUsage 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 times contain mate…

fusion-icon - Tray Icon to Manage to Manage Compiz

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-iconAnd add fusion-icon command to your sessions.

Profiling PHP Using xdebug & kcachegrind

See the blogpost on xdebug installation before continuing.Enable ProilingYou need to add following line to /etc/php5/apache2/php.ini to enable profiling of php scripts.xdebug.profiler_enable=1Now restart the apache server by issuing following command.sudo apache2ctl restartWhen 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=OnNow you can trigger profiling of specific requests by adding X…

Debugging PHP Using xdebug

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.InstallationYou need to install following packages to prepare environment for installation of pecl module xdebug.sudo apt-get -y install php-pear php5-dev build-essentialNow we install xdebug using pecl.sudo pecl install xdebugAbove command will download, compile & install xdebug on your system.ConfigurationOpen /etc/php5/apache2/php.ini and append following line.zend_extension=/usr/lib/php5/20060613/xdebug.soBe careful about that number part in the path as it could be different for you. Now restart apache by issuing following command.sudo apache2ctl restartNow try to view the output of your phpinfo() function. If you find xdebug word in that then it means you have successfully installed xdebug.Stacktracexdebug.collect_params accepts values from 1 to 4. Where 1 refers to less verbosity…

Installing LAMP Server Stack.

ApacheApache is a free & widely used web server. To install it on your local system execute following command.sudo apt-get -y install apache2You might get following warning when starting apache web server.apache2: Could not reliably determine the server's fully qualified domain name, using for ServerNameAdd following line to /etc/apache2/apache2.conf to slience the warning.ServerName localhostTo test the installation enter http://localhost in addressbar of your browser and you should see the message It works!.Visit Apache HTTP Server site.PHPPHP 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-php5By 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/hello.php file and save it.<?php phpin…

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 - 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 kerning & ligatur…

List of Popular PPA Repositories

Mozilladeb intrepid main deb-src intrepid mainGoogle Gadgetsdeb hardy main deb-src hardy mainUbuntu Netbook Remixdeb hardy main deb-src hardy mainBanshee Teamdeb hardy main deb-src hardy mainUbuntu Backportersdeb hardy main deb-src hardy mainMythbuntudeb hardy main deb-src hardy mainKDE4deb hardy main deb-src hardy mainCompizdeb http…

TimeVault - Backup your files

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

People who are using compiz have two ways to automatically start emerald upon login.Using SessionsThis method involves adding following command to sessions.emerald --replace &Using compiz-decoratorThis method involves changing a line inside the file /usr/bin/compiz-decorator fromUSE_EMERALD="no"toUSE_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 mooEnjoy ubuntu. :)

Open new firefox tab in background

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.loadDivertedInBackgroundNow 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

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-serveredubuntu-serverlamp-serverubuntu-desktopubuntu-livemail-serveropenssh-serverprint-serversamba-servermyubuntu-desktopubuntustudio-desktopYou can get complete list of tasks by executing following command.tasksel --list-tasksHere 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 noSave the file and exit the editor.Now restart ssh service by executing following command.sudo /etc/init.d/ssh restartFrom now on your ssh logins should work like a breeze.