<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Jereme&#039;s World</title>
	<atom:link href="http://abhishekdelta.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://abhishekdelta.wordpress.com</link>
	<description>Abhishek Shrivastava&#039;s Web-log</description>
	<lastBuildDate>Fri, 30 Dec 2011 21:43:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='abhishekdelta.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/7f88d29de5a40d65b32d7051b7c3e0fb?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Jereme&#039;s World</title>
		<link>http://abhishekdelta.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://abhishekdelta.wordpress.com/osd.xml" title="Jereme&#039;s World" />
	<atom:link rel='hub' href='http://abhishekdelta.wordpress.com/?pushpress=hub'/>
		<item>
		<title>svnlogger v0.1</title>
		<link>http://abhishekdelta.wordpress.com/2011/06/24/svnlogger-v0-1/</link>
		<comments>http://abhishekdelta.wordpress.com/2011/06/24/svnlogger-v0-1/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 05:26:26 +0000</pubDate>
		<dc:creator>abhishekdelta</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[changelog]]></category>
		<category><![CDATA[Open Source Softwares]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://abhishekdelta.wordpress.com/?p=367</guid>
		<description><![CDATA[This one is for the Unix freaks (that includes me !).  Remember the textual &#8220;ChangeLog&#8221; files we used to see in a lot of open source softwares ? It used to have the list of changes made to the software &#8230; <a href="http://abhishekdelta.wordpress.com/2011/06/24/svnlogger-v0-1/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=367&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This one is for the Unix freaks (that includes me !).  Remember the textual &#8220;ChangeLog&#8221; files we used to see in a lot of open source softwares ? It used to have the list of changes made to the software along with revisions number, contributor&#8217;s name and timestamp. I always liked the format of a particular kind of ChangeLog which showed all the details in a compact manner without losing any, helps me keep track of &#8216;What&#8217;s new!&#8217; in my next version of the software. Anyways, so how do I make it ? For those of you who have been thinking that they&#8217;re hand-written, you&#8217;re so wrong ! After all, how can you expect an open source freak to do something &#8216;manually&#8217; when he can easily automate any task in his computer using cool scripts ?? Anyways, usually they have some kind of Version Tracking System like CVS, SVN or GIT. I happen to use SVN most of the time, actually always, and since I needed to maintain a ChangeLog as well, I found there was a nice command called &#8220;svn log&#8221; which would generate a textual log of all the commits along with all the information I needed to see. Well, everything was there, but not in a way I wanted it to be. &#8216;svn log&#8217; is good enough for &#8216;grep&#8217; but not so good in terms of direct readability. So I wrote this small shell script that is basically a wrapper around the svn log but it uses AWK to reformat the data in a way I like it !</p>
<p>Copy paste the code below into a file called &#8216;svnlogger.sh&#8217; and then execute it like</p>
<blockquote><p>&gt; sh svnlogger.sh &lt;path-to-svn-repo&gt; &lt;path-to-changelog&gt;</p></blockquote>
<p>If you don&#8217;t mention either of &lt;path-to-svn-repo&gt; or &lt;path-to-changelog&gt;, it would take the current directory as default. Here&#8217;s a sample of the ChangeLog generated :</p>
<blockquote><p>Revision 285  by  abhishekdelta  on  2011-03-11 20:59:2<br />
Description : Fixed URL Rewrite bugs #115 and #117<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Revision 284  by  chakradarraju  on  2011-03-11 18:21:0<br />
Description : Ticket #122, activating/deactivating/deleting multiple users<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Revision 283  by  abhishekdelta  on  2011-03-11 04:21:2<br />
Description : Auto detection of Rewrite engine during installation #98<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Revision 282  by  chakradarraju  on  2011-03-09 05:36:4<br />
Description : Ticket #120 &#8211; Permissions improvement<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Revision 281  by  scriptle  on  2011-03-07 22:21:5<br />
Description : User Public Profile &#8211; Redirection Only.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p></blockquote>
<p>&#8230;.</p>
<p>Here goes the code :<br />
<span id="more-367"></span><br />
<pre class="brush: bash;">
 #!/bin/bash
 #
 # Prints the usage details
 #
 print_help()
 {
 echo &quot;svnlogger 0.1 by Abhishek Shrivastava [i.abhi27[at]gmail.com]&quot;;
 echo &quot;Usage : $0 [options] [svn root] [changelog]&quot;
 echo &quot;options include:&quot;;
 echo &quot; -h : Use HTML output&quot;;
 echo &quot; -x : Use TEXT output (default)&quot;;
 echo &quot; -t path : use path as template folder instead of default (Only with -h)&quot;;
 echo &quot;svnroot : The root directory of SVN Repo. Default = ./&quot;;
 echo &quot;changelog : The path of changelog file. Default = ./ChangeLog&quot;;
 return
 }

#
 # Prints an error
 #

print_error()
 {
 case &quot;$1&quot; in
 1) echo &quot;Error : -x and -h cannot be both set&quot;;;
 2) echo &quot;Error : -h must be set before using -t&quot;;;
 esac
 exit 1;
 }

#
 # Generates text log
 #

generate_text_log()
 {
 SVNROOT=$1
 CHANGELOG=$2
 : ${SVNROOT:=&quot;./&quot;}
 : ${CHANGELOG:=&quot;./ChangeLog&quot;}
 svn log -r HEAD:1 $SVNROOT | grep -v &quot;^$&quot; | grep -v ^- | awk -F &quot;|&quot; '
 BEGIN{
 username=&quot;&quot;
 date=&quot;&quot;
 revno=&quot;&quot;
 }
 {
 if($1 ~ /^r[0-9]*/)
 {
 username=$2
 date=substr($3,1,19)
 revno=substr($1,2)
 }
 else
 {
 print &quot;Revision &quot; revno &quot; by &quot; username &quot; on &quot; date
 print &quot;Description : &quot; $1
 print &quot;--------------------------------------------------------------------------------&quot;
 }
 }
 END{
 print &quot;Log generated using svnlogger v0.1 by abhishekdelta&quot;
 }' &gt; $CHANGELOG
 }

#
 # Generate HTML log
 #

generate_html_log()
 {
 echo &quot;hey&quot;
 }
 #
 # Main procedure begins here
 #

#
 # Parse arguments
 #
 while getopts hxt: opt
 do
 case &quot;$opt&quot; in
 h) if [ -z &quot;$TEXT&quot; ] ;
 then
 HTML=&quot;true&quot;
 else print_error 1;
 fi ;;
 t) if [ ! -z &quot;$HTML&quot; ] ;
 then
 TEMPLATE=&quot;$OPTARG&quot;
 else print_error 2;
 fi ;;
 x) if [ -z &quot;$HTML&quot; ] ;
 then
 TEXT=&quot;true&quot;
 else print_error 1;
 fi ;;
 [?]) print_help; exit 1;;
 esac
 done

#
 # Generate Log
 #
 if [ -z &quot;$HTML&quot; ] || [ $TEXT -eq &quot;true&quot; ] ;
 then
 echo &quot;Generating text log ..... &quot;
 generate_text_log;
 echo &quot; done!&quot;
 else
 echo &quot;Generating html log ..... &quot;
 generate_html_log;
 echo &quot; done!&quot;
 fi

</pre></p>
<br />Filed under: <a href='http://abhishekdelta.wordpress.com/category/tech/linux/'>Linux</a>, <a href='http://abhishekdelta.wordpress.com/category/tech/'>Tech</a> Tagged: <a href='http://abhishekdelta.wordpress.com/tag/changelog/'>changelog</a>, <a href='http://abhishekdelta.wordpress.com/tag/linux/'>Linux</a>, <a href='http://abhishekdelta.wordpress.com/tag/open-source-softwares/'>Open Source Softwares</a>, <a href='http://abhishekdelta.wordpress.com/tag/svn/'>svn</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/abhishekdelta.wordpress.com/367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/abhishekdelta.wordpress.com/367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/abhishekdelta.wordpress.com/367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/abhishekdelta.wordpress.com/367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/abhishekdelta.wordpress.com/367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/abhishekdelta.wordpress.com/367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/abhishekdelta.wordpress.com/367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/abhishekdelta.wordpress.com/367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/abhishekdelta.wordpress.com/367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/abhishekdelta.wordpress.com/367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/abhishekdelta.wordpress.com/367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/abhishekdelta.wordpress.com/367/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/abhishekdelta.wordpress.com/367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/abhishekdelta.wordpress.com/367/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=367&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://abhishekdelta.wordpress.com/2011/06/24/svnlogger-v0-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1bb9d7dc24625f22d2fa57464e9569b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">jereme</media:title>
		</media:content>
	</item>
		<item>
		<title>Perfect configuration for Conky</title>
		<link>http://abhishekdelta.wordpress.com/2011/04/19/perfect-configuration-for-conky/</link>
		<comments>http://abhishekdelta.wordpress.com/2011/04/19/perfect-configuration-for-conky/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 20:54:51 +0000</pubDate>
		<dc:creator>abhishekdelta</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Arch Linux]]></category>
		<category><![CDATA[Conky]]></category>
		<category><![CDATA[Conky Configuration]]></category>

		<guid isPermaLink="false">http://abhishekdelta.wordpress.com/?p=452</guid>
		<description><![CDATA[Okay, this one&#8217;s about some eye candy. One thing I regretted while parting my ways with Ubuntu was the good looking themes and applets it had. But no more, as they say, &#8216;thou shall seek, thou shall find&#8217; and I&#8217;ve &#8230; <a href="http://abhishekdelta.wordpress.com/2011/04/19/perfect-configuration-for-conky/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=452&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Okay, this one&#8217;s about some eye candy. One thing I regretted while parting my ways with Ubuntu was the good looking themes and applets it had. But no more, as they say, &#8216;thou shall seek, thou shall find&#8217; and I&#8217;ve found whatever I needed in Arch Linux. After configuring everything, from kernel modules to gnome, I finally came to peace with the last missing piece in my puzzle &#8211; the Conky system monitor. Configuring it to suit the looks of my desktop was a hell of a task but I finally succeeded thanks to numerous tutorials on the internet and needless to say, google. For starters, Conky is just a system monitor that can be configured to monitor everything from your CPU&#8217;s temperature to internet speed to processes and hard disk space. You can even configure it to monitor your email or some RSS feeds you like. And the best part, is the looks, okay, take a look : <a href="http://abhishekdelta.files.wordpress.com/2011/04/conky.png"><img class="aligncenter size-medium wp-image-453" title="Conky" src="http://abhishekdelta.files.wordpress.com/2011/04/conky.png?w=300&#038;h=187" alt="" width="300" height="187" /></a></p>
<p>You like it ? You can have it for yourself. If you&#8217;re in Arch Linux like me, just do</p>
<blockquote><p>pacman -S conky</p></blockquote>
<p>For any other distro, use the appropriate command. For Ubuntu,</p>
<blockquote><p>sudo apt-get install conky</p></blockquote>
<p>For Fedora,</p>
<blockquote><p>sudo yum install conky</p></blockquote>
<p>Finally, when you&#8217;ve done that. Its time to configure it. Below, I&#8217;m posting the perfect configuration which should run out-of-the-box in your system with no dependencies. Copy the below code to a file named &#8220;.conkyrc&#8221; and put it in your home folder. Final path should be : ~/.conkyrc</p>
<p>Once you&#8217;ve done that. Simply type &#8220;conky &amp;&#8221; in the shell <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Conky configuration :<br />
<pre class="brush: plain;">
# Conky configuration  by Abhishek Shrivastava [http://abhishekdelta.wordpress.com]
# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048

# Update interval in seconds
update_interval 1

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type override
own_window_hints undecorate,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 150 0

#maximum_width 150

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_inner_margin 5

# border width
border_width 1

# Default colors and also border colors
default_color white
#default_shade_color white
#default_outline_color black
own_window_colour white

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 40
gap_y 40

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none

TEXT
JEREME ARCH LINUX ${hr 2}

${voffset 2}${font OpenLogos:size=16}u${font}   Kernel:  ${alignr}${kernel}
${font StyleBats:size=16}q${font}   Uptime: ${alignr}${uptime}
${font StyleBats:size=16}A${font}   CPU1: ${cpu cpu1}% ${alignr}${cpubar cpu1 8,60}
${font StyleBats:size=16}A${font}   CPU2: ${cpu cpu2}% ${alignr}${cpubar cpu2 8,60}
${font StyleBats:size=16}g${font}   RAM: $memperc% ${alignr}${membar 8,60}
${font Webdings:size=16}~${font}  Battery: ${battery_percent BAT0}% ${alignr}${battery_bar 8,60 BAT0}
${font StyleBats:size=16}q${font}   Uptime: ${alignr}${uptime}

${color white}Cpu: ${color white}${alignr}$cpu%
${color white}${cpugraph 20,170 white white}

${color white}Ram:  ${color white}$memperc%  ${alignr 4}$mem/$memmax
${color white}${membar 3,170}

${color white}Disk IO:${color white} ${alignr 4}$diskio
${color white}${diskiograph 20,170 white white}
${color white}Root:  ${color white}${alignr 4}${fs_free /}
${color white}${fs_bar 3,170 /}

${if_existing /proc/net/route ppp0}
WIRELESS NETWORK ${hr 2}
${voffset 4}${font PizzaDude Bullets:size=14}O${font}${color white}Up:${color white}${alignr 4}${upspeed ppp0}k/s
${color white}${upspeedgraph ppp0 20,170 white white}
${voffset 4}${font PizzaDude Bullets:size=14}N${font}${color white}Total:${color white} ${totalup ppp0}
${voffset 4}${font PizzaDude Bullets:size=14}U${font}${color white}Down:${color white}${alignr 4}${downspeed ppp0}k/s
${color white}${downspeedgraph ppp0 20,170 white white}
${voffset 4}${font PizzaDude Bullets:size=14}T${font}${color white}Total: ${color white}${totaldown ppp0}
${voffset 4}${font PizzaDude Bullets:size=14}a${font}${color white}Local Ip: ${color white}${addr ppp0}
${else}${if_existing /proc/net/route eth0}
ETHERNET NETWORK ${hr 2}
${voffset 4}${font PizzaDude Bullets:size=14}O${font}${color 776241}Up:${color 707070}${alignr 4}${upspeed eth0}k/s
${color 3E3629}${upspeedgraph eth0 20,85 3E3629 776241}
${voffset 4}${font PizzaDude Bullets:size=14}N${color 776241}Total:${color 707070} ${totalup eth0}
${voffset 4}${font PizzaDude Bullets:size=14}U${color 776241}Down:${color 707070}${alignr 4}${downspeed eth0}k/s
${color 3E3629}${downspeedgraph eth0 20,85 3E3629 776241}
${voffset 4}${font PizzaDude Bullets:size=14}T${color 776241}Total: ${color 707070}${totaldown eth0}
${voffset 4}${font PizzaDude Bullets:size=14}a${color white}Local Ip: ${color white}${addr eth0}
${endif}${endif}

PROCESSES ${hr 2}
NAME $alignr PID    CPU
${top name 1} $alignr ${top pid 1} ${top cpu 1}
${top name 2} $alignr ${top pid 2} ${top cpu 2}
${top name 3} $alignr ${top pid 3} ${top cpu 3}
${top name 4} $alignr ${top pid 4} ${top cpu 4}
${top name 5} $alignr ${top pid 5} ${top cpu 5}
${top name 6} $alignr ${top pid 6} ${top cpu 6}
</pre><br />
Hope you liked it and appreciated it. You&#8217;re free to change the above configuration to suit your needs and distribute it. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />Filed under: <a href='http://abhishekdelta.wordpress.com/category/tech/linux/'>Linux</a>, <a href='http://abhishekdelta.wordpress.com/category/tech/'>Tech</a> Tagged: <a href='http://abhishekdelta.wordpress.com/tag/arch-linux/'>Arch Linux</a>, <a href='http://abhishekdelta.wordpress.com/tag/conky/'>Conky</a>, <a href='http://abhishekdelta.wordpress.com/tag/conky-configuration/'>Conky Configuration</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/abhishekdelta.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/abhishekdelta.wordpress.com/452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/abhishekdelta.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/abhishekdelta.wordpress.com/452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/abhishekdelta.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/abhishekdelta.wordpress.com/452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/abhishekdelta.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/abhishekdelta.wordpress.com/452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/abhishekdelta.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/abhishekdelta.wordpress.com/452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/abhishekdelta.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/abhishekdelta.wordpress.com/452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/abhishekdelta.wordpress.com/452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/abhishekdelta.wordpress.com/452/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=452&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://abhishekdelta.wordpress.com/2011/04/19/perfect-configuration-for-conky/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1bb9d7dc24625f22d2fa57464e9569b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">jereme</media:title>
		</media:content>

		<media:content url="http://abhishekdelta.files.wordpress.com/2011/04/conky.png?w=300" medium="image">
			<media:title type="html">Conky</media:title>
		</media:content>
	</item>
		<item>
		<title>Upgrading to PHP 5.3 in Ubuntu</title>
		<link>http://abhishekdelta.wordpress.com/2010/12/27/upgrading-to-php-5-3-in-ubuntu/</link>
		<comments>http://abhishekdelta.wordpress.com/2010/12/27/upgrading-to-php-5-3-in-ubuntu/#comments</comments>
		<pubDate>Sun, 26 Dec 2010 20:37:15 +0000</pubDate>
		<dc:creator>abhishekdelta</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Softwares]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[HTTP Extension]]></category>
		<category><![CDATA[Migration to PHP 5.3]]></category>
		<category><![CDATA[PHP 5.3]]></category>
		<category><![CDATA[phpMyAdmin]]></category>
		<category><![CDATA[Upgrading]]></category>

		<guid isPermaLink="false">http://abhishekdelta.wordpress.com/?p=442</guid>
		<description><![CDATA[I&#8217;ve been using PHP 5.2 for a long time now. I&#8217;m not so apt towards change but PHP 5.3 has some cool features which I needed very much for my projects. So yesterday I decided to do that conversion. The &#8230; <a href="http://abhishekdelta.wordpress.com/2010/12/27/upgrading-to-php-5-3-in-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=442&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using PHP 5.2 for a long time now. I&#8217;m not so apt towards change but PHP 5.3 has some cool features which I needed very much for my projects. So yesterday I decided to do that conversion. The process was not at all so simple and it took lots of googling and searching the forums, especially for removing the post-installation bugs. Finally, at <em>Dec 27 12:45 AM</em> I achieved 100% transformation to PHP 5.3. As my usual habit, I like documenting the stuff I do, so here it goes.</p>
<p>First thing before starting the process is to make sure that none of my existing projects would break. Because as the developers have said, PHP 5.3 is a major release with lots of changes. Many new features were added while many were removed or deprecated. And to avoid getting unnecessary warnings or notices, it was better to recheck my codes for compatibility with PHP 5.3. The PHP developers have written a good page in the PHP Manual which tells in detail about the things to take care of when migrating to 5.3 from 5.2. You can check it here : <a href="http://php.net/manual/en/migration53.php">http://php.net/manual/en/migration53.php</a></p>
<p>So don&#8217;t forget to go through that page once, at the least the section which tells about the &#8220;removed and deprecated&#8221; features in PHP 5.3 and use the alternatives as suggested. Now you&#8217;re ready to upgrade. BUT, before that, you&#8217;ve to know that any software you use like phpMyAdmin or ldapPhpAdmin which uses PHP might broke. Well, you cannot do anything about it but you&#8217;ll have to reinstall them. Anyways, moving ahead, take a backup copy of your <strong>php.ini</strong> configuration file. You may need it for reconfiguring your PHP 5.3. If you&#8217;re using Apache 2, it can be found in <strong>/etc/php5/apache2/php.ini</strong></p>
<p>Now, just run the following commands one by one,<br />
<pre class="brush: plain;">
wget http://us.archive.ubuntu.com/ubuntu/pool/main/k/krb5/libkrb53_1.6.dfsg.4~beta1-5ubuntu2_i386.deb

sudo dpkg -i libkrb53_1.6.dfsg.4~beta1-5ubuntu2_i386.deb

wget http://us.archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu38_3.8-6ubuntu0.2_i386.deb

sudo dpkg -i libicu38_3.8-6ubuntu0.2_i386.deb
</pre><br />
Now open <strong>sources.list</strong> using the following command :</p>
<blockquote><p>sudo vim /etc/apt/sources.list</p></blockquote>
<p>Add the following sources and save the file-<br />
<pre class="brush: plain;">
deb http://php53.dotdeb.org stable all
deb-src http://php53.dotdeb.org stable all
</pre><br />
Now rest of the commands :<br />
<pre class="brush: plain;">
sudo apt-get update

sudo apt-get install php5-cli

sudo /etc/init.d/apache2 restart
</pre><br />
It may ask what to do about the new php.ini file. Choose to use the packager&#8217;s version of it. If its asks about removing phpmyadmin and would you like to use db-common, select NO if you want to preserver your databases. Thats it.</p>
<p>You&#8217;re done! Congratulations. You can check the version number from the output of <code>phpinfo();</code> or in your command prompt type <code>php -v</code> to assure yourself. But the game is not over yet <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  for the post-installation bugs are still roaming everywhere in your PHP installation. The bugs may vary for you, as it depends on the exact installation specifications, but I&#8217;ll tell you about the bugs I faced and if you have something in common, you can use the solution that worked for me. Lets refer to Post-Installation Bug as &#8220;<em>PIB</em>&#8220;.<br />
<span id="more-442"></span><br />
<strong>PIB 1 </strong>: phpMyAdmin got uninstalled during the process of upgrading ! And when trying to install using &#8220;sudo apt-get install phpmyadmin&#8221;, it failed as it required php-mcrypt module which it seems cannot be installed in PHP 5.3.</p>
<p><em>Solution :</em> Manual installation and configuration of phpMyAdmin. Let&#8217;s talk :</p>
<p>First download the latest phpMyAdmin from here : <a href="http://www.phpmyadmin.net/home_page/downloads.php">http://www.phpmyadmin.net/home_page/downloads.php</a></p>
<p>Extract the contents to a folder inside your webserver folder, say <strong>/var/www/phpMyAdmin</strong></p>
<p>The extracted files and folders should be directly inside<strong> /var/www/phpMyAdmin</strong> folder and not inside some other folder within it like <strong>/var/www/phpMyAdmin/phpMyAdmin-3.*.*/</strong>.</p>
<p>Now you&#8217;ve to create a config folder inside it with world writable permissions. You can run the following commands :<br />
<pre class="brush: plain;">cd phpMyAdmin
mkdir config                       
chmod o+rw config                 
</pre><br />
Now, from your browser, goto location <strong>http://localhost/phpMyAdmin/setup</strong> and fill out the information. You&#8217;ll have to create new server entry and use the default settings only. Also in <strong>auth_user</strong>, and<strong> auth_password</strong>, leave as it is. Nowhere you should write any username and passwords. And <strong>auth_type</strong> should be <em>cookie</em>. Now click on SAVE button below and a config.inc.php file would be generated inside the config folder you just created. If its not for some reason, then you can click the DOWNLOAD button and download the file. Then move the file to phpMyAdmin folder and remove the world-writable permission. Here&#8217;s the code (assuming you&#8217;re inside the phpMyAdmin folder) :<br />
<pre class="brush: plain;">
mv config/config.inc.php .      
chmod o-rw config.inc.php         
</pre><br />
Now you&#8217;re done, phpMyAdmin should be up and running at <strong>http://localhost/phpMyAdmin</strong></p>
<p>The sourcecode of phpMyAdmin is right now inside your webserver&#8217;s folder. I didn&#8217;t like that and may be you too. It was supposed to be at location <strong>/usr/share/phpmyadmin</strong>. Well there&#8217;s a simple way to do it. Just copy the entire phpMyAdmin folder to <strong>/usr/share</strong> and rename it to &#8216;phpmyadmin&#8217; (all small caps). Now, open an editor and copy the following code :<br />
<pre class="brush: plain;">
# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

&lt;Directory /usr/share/phpmyadmin&gt;
Options Indexes FollowSymLinks
DirectoryIndex index.php

&lt;IfModule mod_php5.c&gt;
AddType application/x-httpd-php .php

php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
&lt;/IfModule&gt;

&lt;/Directory&gt;

# Authorize for setup
&lt;Directory /usr/share/phpmyadmin/setup&gt;
&lt;IfModule mod_authn_file.c&gt;
AuthType Basic
AuthName &quot;phpMyAdmin Setup&quot;
AuthUserFile /etc/phpmyadmin/htpasswd.setup
&lt;/IfModule&gt;
Require valid-user
&lt;/Directory&gt;

# Disallow web access to directories that don't need it
&lt;Directory /usr/share/phpmyadmin/libraries&gt;
Order Deny,Allow
Deny from All
&lt;/Directory&gt;
&lt;Directory /usr/share/phpmyadmin/setup/lib&gt;
Order Deny,Allow
Deny from All
&lt;/Directory&gt;
</pre><br />
Save the file as phpmyadmin.conf and copy it to your apache&#8217;s configuration folder. In my case, its <strong>/etc/apache2/conf.d</strong> (You will require root permissions).</p>
<p>Then, just reload your apache :</p>
<blockquote><p>sudo /etc/init.d/apache2 reload</p></blockquote>
<p>Then goto http://localhost/phpmyadmin and it will work smoothly. I didn&#8217;t do anything about the mcrypt extension problem because I was only using it on my local computer. However, if you&#8217;re some corporate guy and doing this for some online application, then I won&#8217;t recommend the above method.</p>
<p><strong>PIB 2 :</strong> PHP PECL Extensions not working properly.<br />
<em><br />
Solution :</em> Install them again. But as with phpmyadmin, it was not so easy.</p>
<p>This is how I installed the HTTP PECL Extension in PHP 5.2<br />
<pre class="brush: plain;">
sudo apt-get install php-pear

sudo apt-get install php5-dev

sudo apt-get install libcurl3-openssl-dev

sudo pecl install pecl_http
</pre><br />
Add &#8220;extension=http.so&#8221; in php.ini</p>
<blockquote><p>sudo /etc/init.d/apache2 restart</p></blockquote>
<p>So we&#8217;ll try to do that again. But first you&#8217;ve to uninstall the packages which may already installed. So just do :<br />
<pre class="brush: plain;">
sudo apt-get remove php-pear

sudo apt-get remove php5-dev

sudo apt-get remove libcurl3-openssl-dev

sudo pecl uninstall pecl_http
</pre><br />
And now when you&#8217;ll do the same process in PHP 5.3, it will generate the error :</p>
<blockquote><p>The following packages have unmet dependencies:<br />
php5-dev: Conflicts: libtool (&gt;= 2.2) but 2.2.6a-4 is to be installed<br />
E: Broken packages</p></blockquote>
<p>Workaround :<br />
<pre class="brush: plain;">cd /tmp

wget http://cz.archive.ubuntu.com/ubuntu/pool/main/libt/libtool/libtool_1.5.26-1ubuntu1_i386.deb

sudo apt-get remove libtool

sudo dpkg   -i libtool_1.5.26-1ubuntu1_i386.deb
</pre><br />
Now after you&#8217;ve done this, do that process again and the PECL HTTP extension would get installed. Now you can install any other PECL extension using the command :</p>
<blockquote><p>sudo pecl install pecl_</p></blockquote>
<p>Also after you install the extension you&#8217;ve to add the following line in your<strong> php.ini</strong> file :</p>
<blockquote><p>extension = .so</p></blockquote>
<p><strong>PIB 3 :</strong> Lots of warning generated wherever I used the date() function.</p>
<p><em>Solution :</em> The default timezone is not set because your previous ini file was overwritten. So just add this line in your <strong>php.ini</strong> file :</p>
<blockquote><p>date.timezone = Asia/Calcutta</p></blockquote>
<p>or whatever your time-zone&#8217;s name is. Just restart apache again and you&#8217;re good to go.</p>
<p>These are the problems I faced and their solutions. You may face other problems, you can if you want, leave a comment telling about your problem and I&#8217;ll try to answer it. Anyways, hope it worked for you and welcome to PHP 5.3 !</p>
<br />Filed under: <a href='http://abhishekdelta.wordpress.com/category/tech/linux/'>Linux</a>, <a href='http://abhishekdelta.wordpress.com/category/tech/php/'>PHP</a>, <a href='http://abhishekdelta.wordpress.com/category/reviews/softwares/'>Softwares</a>, <a href='http://abhishekdelta.wordpress.com/category/tech/ubuntu/'>Ubuntu</a> Tagged: <a href='http://abhishekdelta.wordpress.com/tag/http-extension/'>HTTP Extension</a>, <a href='http://abhishekdelta.wordpress.com/tag/migration-to-php-5-3/'>Migration to PHP 5.3</a>, <a href='http://abhishekdelta.wordpress.com/tag/php/'>PHP</a>, <a href='http://abhishekdelta.wordpress.com/tag/php-5-3/'>PHP 5.3</a>, <a href='http://abhishekdelta.wordpress.com/tag/phpmyadmin/'>phpMyAdmin</a>, <a href='http://abhishekdelta.wordpress.com/tag/ubuntu/'>Ubuntu</a>, <a href='http://abhishekdelta.wordpress.com/tag/upgrading/'>Upgrading</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/abhishekdelta.wordpress.com/442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/abhishekdelta.wordpress.com/442/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/abhishekdelta.wordpress.com/442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/abhishekdelta.wordpress.com/442/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/abhishekdelta.wordpress.com/442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/abhishekdelta.wordpress.com/442/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/abhishekdelta.wordpress.com/442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/abhishekdelta.wordpress.com/442/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/abhishekdelta.wordpress.com/442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/abhishekdelta.wordpress.com/442/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/abhishekdelta.wordpress.com/442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/abhishekdelta.wordpress.com/442/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/abhishekdelta.wordpress.com/442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/abhishekdelta.wordpress.com/442/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=442&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://abhishekdelta.wordpress.com/2010/12/27/upgrading-to-php-5-3-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1bb9d7dc24625f22d2fa57464e9569b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">jereme</media:title>
		</media:content>
	</item>
		<item>
		<title>D. E. Shaw placement experience</title>
		<link>http://abhishekdelta.wordpress.com/2010/12/20/d-e-shaw-placement-experience/</link>
		<comments>http://abhishekdelta.wordpress.com/2010/12/20/d-e-shaw-placement-experience/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 09:47:47 +0000</pubDate>
		<dc:creator>abhishekdelta</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[D. E. Shaw]]></category>
		<category><![CDATA[hyderabad]]></category>
		<category><![CDATA[interviews]]></category>
		<category><![CDATA[placements]]></category>
		<category><![CDATA[technical interview]]></category>

		<guid isPermaLink="false">http://abhishekdelta.wordpress.com/?p=438</guid>
		<description><![CDATA[[ REMOVED DUE TO COMPANY POLICY ] SORRY ! Filed under: Personal, Reviews Tagged: D. E. Shaw, hyderabad, interviews, placements, technical interview<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=438&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><span style="color:#000000;"><strong>[ REMOVED DUE TO COMPANY POLICY<span style="color:#ff0000;"> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </span> ]</strong></span><span style="color:#ff0000;"><strong> SORRY !</strong></span></p>
<br />Filed under: <a href='http://abhishekdelta.wordpress.com/category/personal/'>Personal</a>, <a href='http://abhishekdelta.wordpress.com/category/reviews/'>Reviews</a> Tagged: <a href='http://abhishekdelta.wordpress.com/tag/d-e-shaw/'>D. E. Shaw</a>, <a href='http://abhishekdelta.wordpress.com/tag/hyderabad/'>hyderabad</a>, <a href='http://abhishekdelta.wordpress.com/tag/interviews/'>interviews</a>, <a href='http://abhishekdelta.wordpress.com/tag/placements/'>placements</a>, <a href='http://abhishekdelta.wordpress.com/tag/technical-interview/'>technical interview</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/abhishekdelta.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/abhishekdelta.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/abhishekdelta.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/abhishekdelta.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/abhishekdelta.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/abhishekdelta.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/abhishekdelta.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/abhishekdelta.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/abhishekdelta.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/abhishekdelta.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/abhishekdelta.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/abhishekdelta.wordpress.com/438/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/abhishekdelta.wordpress.com/438/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/abhishekdelta.wordpress.com/438/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=438&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://abhishekdelta.wordpress.com/2010/12/20/d-e-shaw-placement-experience/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1bb9d7dc24625f22d2fa57464e9569b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">jereme</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP Optimizations</title>
		<link>http://abhishekdelta.wordpress.com/2010/11/27/php-optimizations/</link>
		<comments>http://abhishekdelta.wordpress.com/2010/11/27/php-optimizations/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 23:01:45 +0000</pubDate>
		<dc:creator>abhishekdelta</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Memcache]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[Output Bufferring]]></category>
		<category><![CDATA[PDO]]></category>

		<guid isPermaLink="false">http://abhishekdelta.wordpress.com/?p=432</guid>
		<description><![CDATA[PHP is my favourite web development language. Here are a few tips I follow to make it even more faster : When you&#8217;re creating PHP files, you&#8217;ll start with &#60;?php tags as usual, but DON&#8217;T end the file with ?&#62; &#8230; <a href="http://abhishekdelta.wordpress.com/2010/11/27/php-optimizations/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=432&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>PHP is my favourite web development language. Here are a few tips I follow to make it even more faster :</p>
<ul>
<li>When you&#8217;re creating PHP files, you&#8217;ll start with <strong>&lt;?php</strong> tags as usual, but DON&#8217;T end the file with <strong>?&gt;</strong> tags if its not your main index.php file. Its optional and ignoring it is not just safe but recommended. So always leave the <strong>&lt;?php</strong> tags unclosed in files which you are going to include in your main file. Do close it properly in your main index.php file though.</li>
<li>Don&#8217;t use functions in FOR loop condition if the function returns the same result always e.g.</li>
</ul>
<p><pre class="brush: plain;">for($i=0; $i&amp;lt;length(arr); $i++)</pre><br />
IS VERY VERY SLOW than<br />
<pre class="brush: plain;">for($i=0, $N=length($arr); $i&amp;lt;$N; $i++)</pre><br />
That&#8217;s because since the condition is checked on every iteration. The function is called again and again to check the lenght of the same array every time. Instead since you know the array length is the same, why not save it in $N so that it won&#8217;t have to calculate it again and again. Though if your array $arr may change in length, you can use that.</p>
<ul>
<li>Initialize all variables before using, just like C++. Although PHP allows uninitialized variables, DO NOT use them. Don&#8217;t forget, this is one of the most important optimizations.</li>
<li>There are global variables in PHP which you access via : <strong>global $var;</strong> . But if you&#8217;re operating on global variables more than twice in the same function, then its better to copy them into a local variable and then do it and then update it again on the global variable. Operating directly on the global variables is quite slow.</li>
<li>By the way, try to avoid using global variables altogether. Don&#8217;t declare your variables global unless you really don&#8217;t have any other option left.</li>
<li>If you&#8217;re using boolean expressions, then use &#8220;true&#8221; instead of &#8220;TRUE&#8221; and &#8220;false&#8221; instead of &#8220;FALSE&#8221; (quotes for clarity). Although both behaves the same, but small lettered ones are faster (yes, I know, but its true!)</li>
<li>Don&#8217;t create variables to store temporary data unnecessarily if you can easily avoid them e.g. <strong>$tmp = func(); return $tmp;</strong> Instead use : <strong>return func();</strong></li>
<li>Just an optional optimization : Static methods are faster than non-static. If you think your method can be made static, make them. Though no compulsion in this particular case.</li>
<li>Although PHP will automatically destroy variables when their scope ends, still if you&#8217;ve created some big variable with huge amount of data, use<strong> unset($var) </strong>to free memory as soon as you no longer need that variable. Don&#8217;t wait for the scope to destroy it. Again, this is also optional and apply it only if you feel your variable can be that huge.</li>
<li>Avoid using<strong> require_once</strong>,<strong>include_once</strong>,<strong>__autoload</strong>,<strong>__get</strong>,<strong>__set </strong>. They&#8217;re very costly.</li>
<li>If you&#8217;re using include and require, give full paths instead of relative paths to avoid PHP wasting time in resolving OS Path.</li>
<li>Try to avoid regular expressions matching, they&#8217;re very slow. If you want to use simple validation, check out the <strong>ctype API</strong>. It can be found under section &#8220;Function Reference&#8221; &gt; &#8220;Variable and Type Related Extensions&#8221; &gt; &#8220;Ctype&#8221; in the PHP Manual. I hope you&#8217;ve downloaded PHP Manual. There&#8217;s no best way to learn PHP than from the Manual. It has lots and lots of examples.</li>
<li>Don&#8217;t suppress errors (if you intend to) using &#8216;@&#8217; in front of functions. They&#8217;re very slow.</li>
<li>Whenever you&#8217;re creating strings, use single-quotes instead of double-quotes wherever possible. But remember that you cannot put variables inside single-quotes strings, in that case use double-quotes. e.g.</li>
</ul>
<p><pre class="brush: plain;">$name=&quot;abhishek&quot;;

$hello=&quot; Hi $name, How are you? &quot;;

return $hello;</pre><br />
CAN BE OPTIMIZED TO<br />
<pre class="brush: plain;">$name='abhishek';

$hello=&quot; Hi $name, How are you? &quot;;

return $hello;</pre><br />
MORE optimization can be done by avoiding $hello variable and directly putting that in the return statement like<br />
<pre class="brush: plain;">return &quot; Hi $name, How are you? &quot;</pre></p>
<ul>
<li>Use &#8216;foreach&#8217; loops instead of &#8216;for&#8217; loops wherever possible</li>
<li>Use &#8216;while&#8217; loops instead of &#8216;for&#8217; loops wherever possible and if you can&#8217;t even use &#8216;foreach&#8217; loops there</li>
<li>Instead of concatenating strings during echo, use the echo comma operator e.g.</li>
</ul>
<p><pre class="brush: plain;">echo $hello.$name.&quot; You last logged in on $time&quot;. $bye;</pre><br />
use<br />
<pre class="brush: plain;">echo $hello,$name,&quot;You last logged in on $time&quot;,$bye;</pre></p>
<ul>
<li>echo is quite slow. So don&#8217;t echo many times. Instead as I mentioned in my last point, get all the variables and then pass them in a single echo command using the comma operator.</li>
<li>There are some pretty cool PHP extensions available out there. One of them is Memcache that will cache your PHP generated HTML pages and if there&#8217;s a HIT in the cache on a page request, your PHP code will not have to be reinterpreted. Caching can improve your code performance by 200 &#8211; 300 % ! There are other caching softwares also like PEAR Cache, Cache Lite, etc. Check it out under &#8220;Appendices&#8221; &gt; &#8220;Extension Categorization&#8221; &gt; &#8220;External Extensions&#8221; &gt; &#8220;Memcache&#8221; in the PHP Manual.</li>
<li>Output buffering is another way to optimize transportation of HTML output to the user. You can use the ob_start() function in the beginning of the code and all the echo functions after that will not actually send the output to the client, but will send it to the output buffer. Once you&#8217;re echoing part is done, use ob_flush() to send the data to the client in one go. You won&#8217;t need this though if you apply the comma-separated echo trick properly. You can learn more about it under section &#8220;Function Reference&#8221; &gt; &#8220;Affecting PHP&#8217;s Behaviour&#8221; &gt; &#8220;Output Control&#8221; in the PHP Manual.</li>
<li>Another way is to compress your HTML code before sending it to the client. A ob_start(&#8220;ob_gzhandler&#8221;); in the beginning of your code will do the trick and similar ob_flush() can be used to send the compressed output. But note that while this will save the network bandwidth, it will increase the computation load on your CPU for compression. So there&#8217;s a trade-off in this case.</li>
<li>Now something about SQL queries, DO NOT USE mysql_query() inside a loop ! Instead, first build the query using the loop and then use a single mysql_query() to execute it.</li>
<li>But actually, for security reasons, don&#8217;t use mysql_query() at all and use Prepared MySQL queries. This will not only relieve you from having to worry about SQL injection attacks, it will also does some query optimization at its end to server you better. PHP already comes with PDO support. Check it out under &#8220;Appendices&#8221; &gt; &#8220;Extension Categorization&#8221; &gt; &#8220;Bundled Extensions&#8221; &gt; &#8220;PDO&#8221; in the PHP Manual</li>
<li>Enabling Apache&#8217;s mod_deflate and mod_gzip can also help.</li>
<li>Set &#8220;AllowOverride&#8221; to &#8220;None&#8221; in the Apache configuration if you actually don&#8217;t need it.</li>
<li>Always put static pages into a separate server than the one hosting your PHP codes. And use some fast filesystem server to access them like thttpd.</li>
</ul>
<p>That&#8217;s all I could think of for now. More tweaks can be done from Apache&#8217;s side also to improve the performance.</p>
<br />Filed under: <a href='http://abhishekdelta.wordpress.com/category/tech/php/'>PHP</a>, <a href='http://abhishekdelta.wordpress.com/category/tech/'>Tech</a>, <a href='http://abhishekdelta.wordpress.com/category/tech/web/'>Web</a> Tagged: <a href='http://abhishekdelta.wordpress.com/tag/apache/'>Apache</a>, <a href='http://abhishekdelta.wordpress.com/tag/memcache/'>Memcache</a>, <a href='http://abhishekdelta.wordpress.com/tag/optimization/'>Optimization</a>, <a href='http://abhishekdelta.wordpress.com/tag/output-bufferring/'>Output Bufferring</a>, <a href='http://abhishekdelta.wordpress.com/tag/pdo/'>PDO</a>, <a href='http://abhishekdelta.wordpress.com/tag/php/'>PHP</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/abhishekdelta.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/abhishekdelta.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/abhishekdelta.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/abhishekdelta.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/abhishekdelta.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/abhishekdelta.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/abhishekdelta.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/abhishekdelta.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/abhishekdelta.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/abhishekdelta.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/abhishekdelta.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/abhishekdelta.wordpress.com/432/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/abhishekdelta.wordpress.com/432/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/abhishekdelta.wordpress.com/432/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=432&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://abhishekdelta.wordpress.com/2010/11/27/php-optimizations/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1bb9d7dc24625f22d2fa57464e9569b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">jereme</media:title>
		</media:content>
	</item>
		<item>
		<title>World’s biggest conspiracy ! (Part 1)</title>
		<link>http://abhishekdelta.wordpress.com/2010/09/10/worlds-biggest-international-scam-part-1/</link>
		<comments>http://abhishekdelta.wordpress.com/2010/09/10/worlds-biggest-international-scam-part-1/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 22:10:29 +0000</pubDate>
		<dc:creator>abhishekdelta</dc:creator>
				<category><![CDATA[Arbit]]></category>
		<category><![CDATA[India]]></category>
		<category><![CDATA[Shocking]]></category>
		<category><![CDATA[World]]></category>
		<category><![CDATA[debt]]></category>
		<category><![CDATA[dollar]]></category>
		<category><![CDATA[government]]></category>
		<category><![CDATA[IMF]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[scandal]]></category>
		<category><![CDATA[United States]]></category>
		<category><![CDATA[US]]></category>
		<category><![CDATA[World Bank]]></category>

		<guid isPermaLink="false">http://abhishekdelta.wordpress.com/?p=385</guid>
		<description><![CDATA[Recently I read an editorial titled &#8220;Uncle Sam&#8217;s Scam&#8221;. It refreshed the memories of a Zeitgeist movie I saw long ago. It was about how the United States has tricked the world to satisfy its avarice and accumulated so much &#8230; <a href="http://abhishekdelta.wordpress.com/2010/09/10/worlds-biggest-international-scam-part-1/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=385&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I read an editorial titled &#8220;Uncle Sam&#8217;s Scam&#8221;. It refreshed the memories of a Zeitgeist movie I saw long ago. It was about how the United States has tricked the world to satisfy its avarice and accumulated so much wealth that not even in the next 50 years can any country dream of. Ironically, many of us are not even aware of the scandal going around us. When our police are busy capturing thieves who stole a few lakhs from the banks, the people who stole Trillions of Dollars are sitting in the White House ( or in the Treasury next to it )! The reason US is also the most technologically advanced nation also lies in this very fact because it&#8217;s obvious that money attracts talent and talent leads to innovation. Here&#8217;s a brief description of the truth (as I see it) :</p>
<p>Let us start with the World Bank&#8217;s list of Top 10 countries by its GDP ( Gross Domestic Product : its the combined sum of all the goods and services produced within the borders of the country. Basically, it is a measure of the economy of a country ) :</p>
<p>(Note : The GDP specified is in Million $ )</p>
<table id="sortable_table_id_1">
<tbody>
<tr>
<td>1</td>
<td><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Flag_of_the_United_States.svg/22px-Flag_of_the_United_States.svg.png" alt="" width="22" height="12" /> <a title="United States" href="http://en.wikipedia.org/wiki/United_States">United States</a></td>
<td>14,204,322</td>
</tr>
<tr>
<td>—</td>
<td><em> <a href="http://en.wikipedia.org/wiki/File:Euro_symbol.svg"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Euro_symbol.svg/18px-Euro_symbol.svg.png" alt="Euro symbol.svg" width="18" height="18" /></a> <a title="Eurozone" href="http://en.wikipedia.org/wiki/Eurozone">Eurozone</a></em></td>
<td>13,565,479<sup><a href="http://en.wikipedia.org/wiki/List_of_countries_by_GDP_%28nominal%29#endnote_3">[3]</a></sup></td>
</tr>
<tr>
<td>2</td>
<td><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/Flag_of_Japan.svg/22px-Flag_of_Japan.svg.png" alt="" width="22" height="15" /> <a title="Japan" href="http://en.wikipedia.org/wiki/Japan">Japan</a></td>
<td>4,909,272</td>
</tr>
<tr>
<td>3</td>
<td><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Flag_of_the_People%27s_Republic_of_China.svg/22px-Flag_of_the_People%27s_Republic_of_China.svg.png" alt="" width="22" height="15" /> <a title="People's Republic of China" href="http://en.wikipedia.org/wiki/People%27s_Republic_of_China">People&#8217;s Republic of China</a></td>
<td>4,326,187<sup><a href="http://en.wikipedia.org/wiki/List_of_countries_by_GDP_%28nominal%29#endnote_2">[2]</a></sup></td>
</tr>
<tr>
<td>4</td>
<td><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Flag_of_Germany.svg/22px-Flag_of_Germany.svg.png" alt="" width="22" height="13" /> <a title="Germany" href="http://en.wikipedia.org/wiki/Germany">Germany</a></td>
<td>3,652,824</td>
</tr>
<tr>
<td>5</td>
<td><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Flag_of_France.svg/22px-Flag_of_France.svg.png" alt="" width="22" height="15" /> <a title="France" href="http://en.wikipedia.org/wiki/France">France</a></td>
<td>2,853,062<sup><a href="http://en.wikipedia.org/wiki/List_of_countries_by_GDP_%28nominal%29#endnote_4">[4]</a></sup></td>
</tr>
<tr>
<td>6</td>
<td><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Flag_of_the_United_Kingdom.svg/22px-Flag_of_the_United_Kingdom.svg.png" alt="" width="22" height="11" /> <a title="United Kingdom" href="http://en.wikipedia.org/wiki/United_Kingdom">United Kingdom</a></td>
<td>2,645,593</td>
</tr>
<tr>
<td>7</td>
<td><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/03/Flag_of_Italy.svg/22px-Flag_of_Italy.svg.png" alt="" width="22" height="15" /> <a title="Italy" href="http://en.wikipedia.org/wiki/Italy">Italy</a></td>
<td>2,293,008</td>
</tr>
<tr>
<td>8</td>
<td><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Flag_of_Brazil.svg/22px-Flag_of_Brazil.svg.png" alt="" width="22" height="15" /> <a title="Brazil" href="http://en.wikipedia.org/wiki/Brazil">Brazil</a></td>
<td>1,612,539</td>
</tr>
<tr>
<td>9</td>
<td><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f3/Flag_of_Russia.svg/22px-Flag_of_Russia.svg.png" alt="" width="22" height="15" /> <a title="Russia" href="http://en.wikipedia.org/wiki/Russia">Russia</a></td>
<td>1,607,816</td>
</tr>
<tr>
<td>10</td>
<td><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Flag_of_Spain.svg/22px-Flag_of_Spain.svg.png" alt="" width="22" height="15" /> <a title="Spain" href="http://en.wikipedia.org/wiki/Spain">Spain</a></td>
<td>1,604,174</td>
</tr>
</tbody>
</table>
<p>It is clearly evident that US figures in the TOP of the list with 14 Trillion $ economy.  The closest is Eurozone or the &#8220;European Union&#8221;, which is actually a union of many European counties, so it cannot be considered as a &#8220;one entity&#8221; and has been excluded from the rankings. So, <em>effectively, </em>Japan is the 2nd country in the list with close to 5 Trillion $ economy. The difference, is 9 Trillion $.</p>
<p>About 200 years ago, India or rather the Indian-subcontinent had the largest economy in the World. Now it ranks 12th. So what did the US do to come to the Top of the list ? Looking into the annals of the period of its independence, we see its conditions were similar to what other countries suffered during independence. Nor there is any clarity in the argument that they&#8217;ve had adequate time to develop and grow given that they got independence in the 18th century, because that would contradict the fact that United Kingdom was never even captured for a millennium and around half of the world (including both India and US ) were under the U.K. territory at not-so-long-ago point in the history. So then what is the arcane recipe to affluence they&#8217;ve got ? The answer is, an amalgam of Debt as Money and the &#8220;Globalized&#8221; Dollar.</p>
<p>While it may seem blatant to us that the US is the richest country in the World, the truth is only partial. What completes the truth is the fact that US is also the most indebted country in the World. Every time the US economy or their budget rose, so did their National Debt. To understand the point I&#8217;m trying to make here, you should have some basic idea about the money system in a country. As of now, I assume you do have a bleak idea about the entities like &#8220;World Bank&#8221;, &#8220;Reserve Bank of India&#8221; or &#8220;US Treasury&#8221;. The important thing to note is that whenever the government needs to spend more money than it actually accrued from the tax revenues, it needs to borrow it from the Central Bank, which in case of India is the RBI and in case of US is the Treasury. The Central Bank allocates the government a loan amount, which the government prints in the form of the national currency (as &#8220;new&#8221; money) and spends it, while in return the government signs &#8220;bonds&#8221; which are nothing but an official agreement of  &#8220;promise&#8221; signed by the government that it will pay back the amount it has borrowed along with the interest back to the Central Bank. Hence, new money is printed by the government only when the Central Bank approves the loan amount which is indirectly restricted by the amount of &#8220;Gold&#8221; the Central Bank has (i.e. there exists a limit up to which the Central Bank can grant loan to the Government and that limit depends on the quantity of gold ). To know the significance of Gold in the current economic structure, you&#8217;ll have to know about the evolution of money system, which is quite an article in itself. Perhaps I&#8217;ll skip that for now to maintain the focus in the current agenda. So, this is the way the creators of this antiquated money system expected it to work. However, years of adulteration by corrupt governments, economists and industrialists have begot a completely different money system that although seems more profitable in the short-run, can annihilate the world in the near future, if left unchecked.</p>
<p>In the current system, the creation of new money is virtually unrestricted unlike in old days when stringent conditions used to control the amount of new money fed into the money supply of a country. Now taking the US example as the case study, the US can literally print money at its will. Without ignoring the fact that being a capitalist economy US government&#8217;s major source of income is from its industrial sector, the US government can still borrow more money whenever they are in need.</p>
<p>In Layman&#8217;s terms, US simply creates the money every time it needs to spend.</p>
<p>This is the end of part 1. In the next part, I&#8217;ll discuss why this bizarre spending and borrowing by the US government doesn&#8217;t hurt its economy. Moreover, how this act of US government actually makes it more richer and sucks money out of the economy of developing countries including India. And finally, what is the role of global entities like World Bank and IMF in this act.</p>
<br />Filed under: <a href='http://abhishekdelta.wordpress.com/category/arbit/'>Arbit</a>, <a href='http://abhishekdelta.wordpress.com/category/world/india/'>India</a>, <a href='http://abhishekdelta.wordpress.com/category/shocking/'>Shocking</a>, <a href='http://abhishekdelta.wordpress.com/category/world/'>World</a> Tagged: <a href='http://abhishekdelta.wordpress.com/tag/debt/'>debt</a>, <a href='http://abhishekdelta.wordpress.com/tag/dollar/'>dollar</a>, <a href='http://abhishekdelta.wordpress.com/tag/government/'>government</a>, <a href='http://abhishekdelta.wordpress.com/tag/imf/'>IMF</a>, <a href='http://abhishekdelta.wordpress.com/tag/india/'>India</a>, <a href='http://abhishekdelta.wordpress.com/tag/money/'>money</a>, <a href='http://abhishekdelta.wordpress.com/tag/scandal/'>scandal</a>, <a href='http://abhishekdelta.wordpress.com/tag/united-states/'>United States</a>, <a href='http://abhishekdelta.wordpress.com/tag/us/'>US</a>, <a href='http://abhishekdelta.wordpress.com/tag/world-bank/'>World Bank</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/abhishekdelta.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/abhishekdelta.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/abhishekdelta.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/abhishekdelta.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/abhishekdelta.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/abhishekdelta.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/abhishekdelta.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/abhishekdelta.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/abhishekdelta.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/abhishekdelta.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/abhishekdelta.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/abhishekdelta.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/abhishekdelta.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/abhishekdelta.wordpress.com/385/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=385&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://abhishekdelta.wordpress.com/2010/09/10/worlds-biggest-international-scam-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1bb9d7dc24625f22d2fa57464e9569b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">jereme</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Flag_of_the_United_States.svg/22px-Flag_of_the_United_States.svg.png" medium="image" />

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Euro_symbol.svg/18px-Euro_symbol.svg.png" medium="image">
			<media:title type="html">Euro symbol.svg</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/Flag_of_Japan.svg/22px-Flag_of_Japan.svg.png" medium="image" />

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Flag_of_the_People%27s_Republic_of_China.svg/22px-Flag_of_the_People%27s_Republic_of_China.svg.png" medium="image" />

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Flag_of_Germany.svg/22px-Flag_of_Germany.svg.png" medium="image" />

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Flag_of_France.svg/22px-Flag_of_France.svg.png" medium="image" />

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Flag_of_the_United_Kingdom.svg/22px-Flag_of_the_United_Kingdom.svg.png" medium="image" />

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/0/03/Flag_of_Italy.svg/22px-Flag_of_Italy.svg.png" medium="image" />

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Flag_of_Brazil.svg/22px-Flag_of_Brazil.svg.png" medium="image" />

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f3/Flag_of_Russia.svg/22px-Flag_of_Russia.svg.png" medium="image" />

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Flag_of_Spain.svg/22px-Flag_of_Spain.svg.png" medium="image" />
	</item>
		<item>
		<title>Quickly configuring an LDAP + NFS client in Fedora</title>
		<link>http://abhishekdelta.wordpress.com/2010/08/15/quickly-configuring-an-ldap-nfs-client-in-fedora/</link>
		<comments>http://abhishekdelta.wordpress.com/2010/08/15/quickly-configuring-an-ldap-nfs-client-in-fedora/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 18:08:20 +0000</pubDate>
		<dc:creator>abhishekdelta</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[autofs]]></category>
		<category><![CDATA[central workplace]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[LDAP Client Configuration]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[NFS Client Configuration]]></category>

		<guid isPermaLink="false">http://abhishekdelta.wordpress.com/?p=401</guid>
		<description><![CDATA[Recently I needed to configure 6 PCs for a central workplace. I needed central authentication as well as Network File System(NFS) on all those machines. All this was to facilitate the people of my technical club (the &#8220;Delta Force&#8221; Webteam) &#8230; <a href="http://abhishekdelta.wordpress.com/2010/08/15/quickly-configuring-an-ldap-nfs-client-in-fedora/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=401&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to configure 6 PCs for a central workplace. I needed central authentication as well as Network File System(NFS) on all those machines. All this was to facilitate the people of my technical club (the &#8220;Delta Force&#8221; Webteam) to use those machines for working on collaborative projects. The central authentication assured that I can easily manage user accounts from say, an LDAP server i.e. I can disable login of a user in a client machine or create a new user without having to touch the client machine at all. Similarly, NFS assured that no matter in which of those 6 machines the user logs in, he will always see the same files in his home directory and same configurations like his background-image, firefox addons, etc on that machine as if he always used the same computer for all his work. This eliminates the problem of people complaining that the machine in which their files resides are being used by someone else.</p>
<p>So my overall network configuration has the following prototype :</p>
<p>1) 6 client machines in which user will be able to login (Subnet of the machines : 10.1.39.0/24)<br />
2) An LDAP server ( IP : 10.0.0.163 ) to take care of authentication when user logs into a client machine<br />
3) The LDAP base DN which has the list of all users is <strong>ou=people,ou=delta,dc=ldap.delta.nitt,dc=edu</strong><br />
4) An NFS server ( IP : 10.0.0.126 ) which has the user home-directories of all users inside /webteam folder.<br />
<strong>Overall working :</strong> When a user (say &#8220;jereme&#8221;) logs into a client machine, his username and password are checked from the LDAP server at 10.0.0.163. If authentication is successful, he&#8217;s logged into the machine and his home directory is actually mounted from /webteam/jereme in the NFS server at 10.0.0.126.</p>
<p>I assume you already have the fully configured LDAP and NFS servers since this article is only about configuring the &#8220;clients&#8221;. So here we go. Pick any of your client machines and do the following :</p>
<p>First we will configure NFS client. For this purpose, we will use the <strong>autofs</strong> package.</p>
<p>Step 1 : Install <strong>nfs-utils</strong> and <strong>autofs</strong></p>
<p>For Ubuntu :</p>
<blockquote><p>
sudo apt-get install nfs-utils autofs
</p></blockquote>
<p>For Fedora :</p>
<blockquote><p>
yum install nfs-utils autofs
</p></blockquote>
<p>Step 2 : Edit the file<strong> /etc/auto.master</strong> and it should contain the following lines :<br />
<pre class="brush: plain;">
/webteam       /etc/auto.home
+auto.master
</pre><br />
Step 3 : Edit<strong> /etc/auto.home</strong> and it should contain the following line :<br />
<pre class="brush: plain;">
      -rw,nfs,soft,intr,nolock             10.0.0.126:/webteam/&amp;
</pre>
</p></blockquote>
<p>Step 4 : Edit<strong> /etc/fstab</strong> and append the following line :<br />
<pre class="brush: plain;">
10.0.0.126:/webteam     /webteam      nfs     soft,rw     0 0
</pre><br />
Step 5 : Edit <strong>/etc/sysconfig/autofs</strong> and it should have the following lines :<br />
<pre class="brush: plain;">
TIMEOUT=300
BROWSE_MODE=&quot;no&quot;
MOUNT_NFS_DEFAULT_PROTOCOL=4
LDAP_URI=&quot;ldap://10.0.0.163&quot;
SEARCH_BASE=&quot;ou=people,ou=delta,dc=ldap.delta.nitt,dc=edu&quot;
USE_MISC_DEVICE=&quot;yes&quot;
</pre><br />
Step 6 : Restart autofs</p>
<blockquote><p>
/etc/init.d/autofs restart
</p></blockquote>
<p>Step 7 : Make autofs start automatically on startup :</p>
<blockquote><p>
chkconfig autofs on
</p></blockquote>
<p>Next, we will configure for the LDAP client.</p>
<p>Step 1 : Install <strong>nss_updatedb</strong> and <strong>openldap-clients</strong></p>
<p>For Ubuntu</p>
<blockquote><p>
sudo apt-get install nss_updatedb openldap-clients
</p></blockquote>
<p>For Fedora</p>
<blockquote><p>
yum install nss_updatedb openldap-clients
</p></blockquote>
<p>Step 2 : Run authconfig-tui from terminal</p>
<blockquote><p>
authconfig-tui
</p></blockquote>
<p>Step 3 : The above will open a graphical window in the terminal. The first page will ask for the login type. It will have 2 columns. In the first column, select &#8220;LDAP authentication&#8221; and in the second column, select &#8220;LDAP,MD5,Shadow and Local Authentication&#8221;. Then click on Next.</p>
<p>Step 4 : Enter the following details when asked for LDAP configurations :<br />
<pre class="brush: plain;">
LDAP URI : http://10.0.0.163
Base DN : ou=people,ou=delta,dc=ldap.delta.nitt,dc=edu
</pre><br />
Also disable &#8220;USE TLS &#8221; option.</p>
<p>Step 5 : Open <strong>/etc/openldap/ldap.conf</strong> and uncomment &#8220;SIZELIMIT, TIMELIMIT and DEREF&#8221; and change it to :<br />
<pre class="brush: plain;">
SIZELIMIT	0
TIMELIMIT	0
DEREF		never
</pre><br />
Step 6 : Open <strong>/etc/nsswitch.conf</strong> and modify :<br />
<pre class="brush: plain;">
passwd:	files sss
shadow:	files	sss
group:	files	sss
</pre><br />
to<br />
<pre class="brush: plain;">
passwd:	files ldap sss
shadow:	files	ldap	sss
group:	files	ldap	sss
</pre><br />
Step 7 : Now, run the following command :</p>
<blockquote><p>
nss_updatedb ldap
</p></blockquote>
<p>That&#8217;s it. You are done <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Now reboot.</p>
<p><strong>Important Note :</strong> Some tools like &#8220;chkconfig&#8221; and &#8220;/etc/nsswitch.conf&#8221; configuration are Fedora-specific. Ubuntu has other alternatives. If you&#8217;re an Ubuntu user, the above configurations might not run for you. But its still worth a try. Good Luck!</p>
<br />Filed under: <a href='http://abhishekdelta.wordpress.com/category/tech/linux/'>Linux</a>, <a href='http://abhishekdelta.wordpress.com/category/tech/networking/'>Networking</a>, <a href='http://abhishekdelta.wordpress.com/category/tech/'>Tech</a>, <a href='http://abhishekdelta.wordpress.com/category/tech/ubuntu/'>Ubuntu</a> Tagged: <a href='http://abhishekdelta.wordpress.com/tag/autofs/'>autofs</a>, <a href='http://abhishekdelta.wordpress.com/tag/central-workplace/'>central workplace</a>, <a href='http://abhishekdelta.wordpress.com/tag/ldap/'>LDAP</a>, <a href='http://abhishekdelta.wordpress.com/tag/ldap-client-configuration/'>LDAP Client Configuration</a>, <a href='http://abhishekdelta.wordpress.com/tag/nfs/'>NFS</a>, <a href='http://abhishekdelta.wordpress.com/tag/nfs-client-configuration/'>NFS Client Configuration</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/abhishekdelta.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/abhishekdelta.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/abhishekdelta.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/abhishekdelta.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/abhishekdelta.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/abhishekdelta.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/abhishekdelta.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/abhishekdelta.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/abhishekdelta.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/abhishekdelta.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/abhishekdelta.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/abhishekdelta.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/abhishekdelta.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/abhishekdelta.wordpress.com/401/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=401&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://abhishekdelta.wordpress.com/2010/08/15/quickly-configuring-an-ldap-nfs-client-in-fedora/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1bb9d7dc24625f22d2fa57464e9569b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">jereme</media:title>
		</media:content>
	</item>
		<item>
		<title>29-May-2010</title>
		<link>http://abhishekdelta.wordpress.com/2010/06/01/379/</link>
		<comments>http://abhishekdelta.wordpress.com/2010/06/01/379/#comments</comments>
		<pubDate>Mon, 31 May 2010 22:39:40 +0000</pubDate>
		<dc:creator>abhishekdelta</dc:creator>
				<category><![CDATA[Arbit]]></category>
		<category><![CDATA[Shocking]]></category>
		<category><![CDATA[29 May 2010]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[high peak]]></category>
		<category><![CDATA[hits per day]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[Wordpress blog stats]]></category>

		<guid isPermaLink="false">http://abhishekdelta.wordpress.com/?p=379</guid>
		<description><![CDATA[Wow, did any one had such a blog statistics graph in WordPress ever ? I have no idea about the reason behind it. Remember the day, 29 May 2010 ! Filed under: Arbit, Shocking Tagged: 29 May 2010, graph, high &#8230; <a href="http://abhishekdelta.wordpress.com/2010/06/01/379/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=379&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://abhishekdelta.files.wordpress.com/2010/05/blog-stats.png"><img class="alignleft size-full wp-image-380" title="Blog-Stats" src="http://abhishekdelta.files.wordpress.com/2010/05/blog-stats.png?w=593" alt=""   /></a></p>
<p>Wow, did any one had such a blog statistics graph in WordPress ever ? I have no idea about the reason behind it. Remember the day, 29 May 2010 !</p>
<br />Filed under: <a href='http://abhishekdelta.wordpress.com/category/arbit/'>Arbit</a>, <a href='http://abhishekdelta.wordpress.com/category/shocking/'>Shocking</a> Tagged: <a href='http://abhishekdelta.wordpress.com/tag/29-may-2010/'>29 May 2010</a>, <a href='http://abhishekdelta.wordpress.com/tag/graph/'>graph</a>, <a href='http://abhishekdelta.wordpress.com/tag/high-peak/'>high peak</a>, <a href='http://abhishekdelta.wordpress.com/tag/hits-per-day/'>hits per day</a>, <a href='http://abhishekdelta.wordpress.com/tag/statistics/'>statistics</a>, <a href='http://abhishekdelta.wordpress.com/tag/wordpress-blog-stats/'>Wordpress blog stats</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/abhishekdelta.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/abhishekdelta.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/abhishekdelta.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/abhishekdelta.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/abhishekdelta.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/abhishekdelta.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/abhishekdelta.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/abhishekdelta.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/abhishekdelta.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/abhishekdelta.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/abhishekdelta.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/abhishekdelta.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/abhishekdelta.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/abhishekdelta.wordpress.com/379/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=379&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://abhishekdelta.wordpress.com/2010/06/01/379/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1bb9d7dc24625f22d2fa57464e9569b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">jereme</media:title>
		</media:content>

		<media:content url="http://abhishekdelta.files.wordpress.com/2010/05/blog-stats.png" medium="image">
			<media:title type="html">Blog-Stats</media:title>
		</media:content>
	</item>
		<item>
		<title>Defending against SQL Injection Attack in PHP any version</title>
		<link>http://abhishekdelta.wordpress.com/2010/05/21/defending-against-sql-injection/</link>
		<comments>http://abhishekdelta.wordpress.com/2010/05/21/defending-against-sql-injection/#comments</comments>
		<pubDate>Fri, 21 May 2010 17:25:09 +0000</pubDate>
		<dc:creator>abhishekdelta</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[addslashes]]></category>
		<category><![CDATA[Internet Security]]></category>
		<category><![CDATA[Magic GPC Quotes]]></category>
		<category><![CDATA[MySQL query]]></category>
		<category><![CDATA[PHP 5.0]]></category>
		<category><![CDATA[SQL Injection]]></category>

		<guid isPermaLink="false">http://abhishekdelta.wordpress.com/?p=356</guid>
		<description><![CDATA[Internet Security is a very sensitive issue and many websites have vulnerabilities which are easily exploitable. One such vulnerability is SQL Injection, in which the attacker can literally execute any kind of query in your database, even gain administrator privileges &#8230; <a href="http://abhishekdelta.wordpress.com/2010/05/21/defending-against-sql-injection/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=356&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Internet Security is a very sensitive issue and many websites have vulnerabilities which are easily exploitable. One such vulnerability is SQL Injection, in which the attacker can literally execute any kind of query in your database, even gain administrator privileges and if things are even worse, then he may also gain access to your system and execute any command. No wonder how dangerous this vulnerability is, but it has a very easy fix. I&#8217;d like to introduce you with a small function escape(), I&#8217;ve written for sanitizing data while querying the database, which will disable SQL Injection attacks in PHP, irrespective of the PHP version you use.</p>
<blockquote><p>function escape($input)<br />
{<br />
if (!get_magic_quotes_gpc()) {<br />
$input = addslashes($input);<br />
}<br />
return $input;</p>
<p>}</p></blockquote>
<p>By default the Magic GPC Quotes feature of PHP is turned ON. So it will automatically sanitize any data it receives from $_GET and $_POST by placing slashes before any &#8216;, &#8221; or \ characters. However, as of PHP 5.0+, this feature is deprecated and hence relying on it is highly discouraged. Instead, use the addslashes() function which does the same thing. So the function I wrote will basically identify whether the Magic GPC feature is turned ON, if it is, then it will simply return the query as it is, else it will call the addslashes() method on the query. So simple !<br />
However, there&#8217;s a more &#8220;secure&#8221; version of it. But this one is not suitable for large-scale systems as it requires an extra-connection to the MySQL server.</p>
<div>
<blockquote><p>function escape($input)<br />
{<br />
if (get_magic_quotes_gpc()) {<br />
$input = stripslashes($input);<br />
}<br />
return mysql_real_escape_string($input);</p>
<p>}</p></blockquote>
</div>
<p>You can use the above function as follows :</p>
<p>Find out all the form variables that you receive in your PHP code i.e. all the occurrences of $_GET and $_POST and whenever you use then, use </p>
<blockquote><p>escape($_POST['var'])</p></blockquote>
<p>instead of just $_POST['var']. Similary for $_GET variables also.</p>
<p>For example, suppose you have stored the mysql query like : </p>
<blockquote><p>
$username=$_GET['username'];<br />
$password=$_POST['password'];<br />
$query=&#8221;SELECT * FROM `users` WHERE `username`=&#8217;$username&#8217; AND `password`=&#8217;$password&#8217;&#8221;;
</p></blockquote>
<p>To secure the above code, use this code instead : </p>
<blockquote><p>
$username=escape($_GET['username']);<br />
$password=escape($_POST['password']);<br />
$query=&#8221;SELECT * FROM `users` WHERE `username`=&#8217;$username&#8217; AND `password`=&#8217;$password&#8217;&#8221;;
</p></blockquote>
<p>or, by writing it in a single line only :</p>
<blockquote><p>
$query=&#8221;SELECT * FROM `users` WHERE `username`=&#8217;&#8221;.escape($username).&#8221;&#8216; AND `password`=&#8217;&#8221;.escape($password).&#8221;&#8216;&#8221;;
</p></blockquote>
<p>This simple thing will completely disable any kind of SQL Injection attacks in your website or web-application, irrespective of the PHP version you use. However, beware of other attacks ! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />Filed under: <a href='http://abhishekdelta.wordpress.com/category/tech/cms/'>CMS</a>, <a href='http://abhishekdelta.wordpress.com/category/tech/php/'>PHP</a>, <a href='http://abhishekdelta.wordpress.com/category/tech/web/'>Web</a> Tagged: <a href='http://abhishekdelta.wordpress.com/tag/addslashes/'>addslashes</a>, <a href='http://abhishekdelta.wordpress.com/tag/internet-security/'>Internet Security</a>, <a href='http://abhishekdelta.wordpress.com/tag/magic-gpc-quotes/'>Magic GPC Quotes</a>, <a href='http://abhishekdelta.wordpress.com/tag/mysql-query/'>MySQL query</a>, <a href='http://abhishekdelta.wordpress.com/tag/php/'>PHP</a>, <a href='http://abhishekdelta.wordpress.com/tag/php-5-0/'>PHP 5.0</a>, <a href='http://abhishekdelta.wordpress.com/tag/sql-injection/'>SQL Injection</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/abhishekdelta.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/abhishekdelta.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/abhishekdelta.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/abhishekdelta.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/abhishekdelta.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/abhishekdelta.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/abhishekdelta.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/abhishekdelta.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/abhishekdelta.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/abhishekdelta.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/abhishekdelta.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/abhishekdelta.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/abhishekdelta.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/abhishekdelta.wordpress.com/356/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=356&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://abhishekdelta.wordpress.com/2010/05/21/defending-against-sql-injection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1bb9d7dc24625f22d2fa57464e9569b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">jereme</media:title>
		</media:content>
	</item>
		<item>
		<title>Connecting MTS Mblaze USB Modem in Ubuntu</title>
		<link>http://abhishekdelta.wordpress.com/2010/05/18/connecting-mts-mblaze-usb-modem-in-ubuntu/</link>
		<comments>http://abhishekdelta.wordpress.com/2010/05/18/connecting-mts-mblaze-usb-modem-in-ubuntu/#comments</comments>
		<pubDate>Tue, 18 May 2010 13:58:03 +0000</pubDate>
		<dc:creator>abhishekdelta</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Mblaze in Ubuntu]]></category>
		<category><![CDATA[MTS in Ubuntu]]></category>
		<category><![CDATA[MTS Mblaze USB Modem]]></category>
		<category><![CDATA[MTS Modem in Ubuntu]]></category>
		<category><![CDATA[Ubuntu 9.04]]></category>
		<category><![CDATA[Ubuntu 9.10]]></category>
		<category><![CDATA[USB Modem]]></category>

		<guid isPermaLink="false">http://abhishekdelta.wordpress.com/?p=353</guid>
		<description><![CDATA[I recently bought myself an MTS Mblaze wireless USB Modem. Connecting it on Linux was difficult because there was practically no tutorial for MTS USB Modem, while many were available for Reliance and Tata Indicom Modems. So here is what &#8230; <a href="http://abhishekdelta.wordpress.com/2010/05/18/connecting-mts-mblaze-usb-modem-in-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=353&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently bought myself an MTS Mblaze wireless USB Modem. Connecting it on Linux was difficult because there was practically no tutorial for MTS USB Modem, while many were available for Reliance and Tata Indicom Modems. So here is what I did to finally get it connected (<span style="text-decoration:underline;"><strong>Note : Execute all commands as ROOT</strong></span> )</p>
<p>i) You&#8217;d have to install the package USB-ModeSwitch. It is available here : <a href="http://packages.debian.org/sid/usb-modeswitch" target="_blank">http://packages.debian.org/sid/usb-modeswitch</a></p>
<p>Note : When you open the above link, you should check out its dependencies and also install the dependency package &#8221; usb-modeswitch-data&#8221;.</p>
<p>Just download and double-click on it to install the package.</p>
<p>ii) After you&#8217;ve installed usb-modeswitch and usb-modeswitch-data packages, reboot your computer.</p>
<p>iii) Connect the Mblaze Modem and wait for 30 seconds. While you&#8217;re waiting, the usb-modeswitch package is doing magic in the background, you can check the status through the following command :</p>
<blockquote><p>dmesg</p></blockquote>
<p>iv) I hope you have &#8220;wvdial&#8221; pre-installed on your system. You can check that by typing &#8220;wvdial&#8221; and see if the computer recognises it. If it doesn&#8217;t then you&#8217;d have to install it. Its easy, refer <a href="http://acomelectronics.com/GeorgeVita/restore_wvdial.html" target="_blank">this link</a>.</p>
<p>v) Now edit the file /etc/wvdial.conf (If it doesn&#8217;t exists, then create it) as Root and copy paste the following code :<br />
<pre class="brush: plain;">[Dialer cdma]
Stupid Mode = 1
Inherits = Modem0
Password = mts
Username = internet@internet.mtsindia.in
Phone = #777

[Modem0]
Init1 = ATZ
SetVolume = 0
Modem = /dev/ttyUSB0
Baud = 115200
FlowControl = Hardware (CRTSCTS)
Dial Command = ATDT</pre><br />
Note that ttyUSB0 may be different for your system. However, first try with the above code, if it doesn&#8217;t works and says some error like &#8220;ttyUSB0 doesn&#8217;t exists&#8221; or something similar to it, then find out the actual one by going through the output of following command :</p>
<blockquote><p>dmesg | grep -e &#8220;modem&#8221; -e &#8220;tty&#8221;</p></blockquote>
<p>vi) That&#8217;s it, you&#8217;re done. Now start browsing with the following command :</p>
<blockquote><p>wvdial cdma</p></blockquote>
<p>As soon as you start seeing some IP addresses, you&#8217;re online! DO NOT close the terminal in which you executed the command, otherwise you will get disconnected.</p>
<p>And from next time, you don&#8217;t have to it all over again. Simply connect your modem, wait for 30 seconds and type the last command. To disconnect, goto the terminal, and press Ctrl + C.</p>
<p>Hope it worked for you, if any problems occured, you can leave a reply !</p>
<br />Filed under: <a href='http://abhishekdelta.wordpress.com/category/tech/'>Tech</a>, <a href='http://abhishekdelta.wordpress.com/category/tech/ubuntu/'>Ubuntu</a>, <a href='http://abhishekdelta.wordpress.com/category/tech/web/'>Web</a> Tagged: <a href='http://abhishekdelta.wordpress.com/tag/mblaze-in-ubuntu/'>Mblaze in Ubuntu</a>, <a href='http://abhishekdelta.wordpress.com/tag/mts-in-ubuntu/'>MTS in Ubuntu</a>, <a href='http://abhishekdelta.wordpress.com/tag/mts-mblaze-usb-modem/'>MTS Mblaze USB Modem</a>, <a href='http://abhishekdelta.wordpress.com/tag/mts-modem-in-ubuntu/'>MTS Modem in Ubuntu</a>, <a href='http://abhishekdelta.wordpress.com/tag/ubuntu-9-04/'>Ubuntu 9.04</a>, <a href='http://abhishekdelta.wordpress.com/tag/ubuntu-9-10/'>Ubuntu 9.10</a>, <a href='http://abhishekdelta.wordpress.com/tag/usb-modem/'>USB Modem</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/abhishekdelta.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/abhishekdelta.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/abhishekdelta.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/abhishekdelta.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/abhishekdelta.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/abhishekdelta.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/abhishekdelta.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/abhishekdelta.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/abhishekdelta.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/abhishekdelta.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/abhishekdelta.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/abhishekdelta.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/abhishekdelta.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/abhishekdelta.wordpress.com/353/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=abhishekdelta.wordpress.com&amp;blog=9679819&amp;post=353&amp;subd=abhishekdelta&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://abhishekdelta.wordpress.com/2010/05/18/connecting-mts-mblaze-usb-modem-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>122</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1bb9d7dc24625f22d2fa57464e9569b?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">jereme</media:title>
		</media:content>
	</item>
	</channel>
</rss>
