<?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/"
	>

<channel>
	<title>twistedgenes.com - Blogs by Rakesh Gupta &#187; Web</title>
	<atom:link href="http://www.twistedgenes.com/category/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.twistedgenes.com</link>
	<description>Blogs on truth, technology, food, linux, leisure, experiences, adventure, romance, friends etc !</description>
	<lastBuildDate>Sat, 12 Jun 2010 14:24:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Video in ASCII using VLC, SSH and refine with ffmpeg</title>
		<link>http://www.twistedgenes.com/2009/11/video-in-ascii-using-vlc-ssh-and-refine-with-ffmpeg/</link>
		<comments>http://www.twistedgenes.com/2009/11/video-in-ascii-using-vlc-ssh-and-refine-with-ffmpeg/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 17:47:01 +0000</pubDate>
		<dc:creator>Rakesh</dc:creator>
				<category><![CDATA[Cool]]></category>
		<category><![CDATA[Crazy]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[all]]></category>
		<category><![CDATA[Ffmpeg]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[VLC]]></category>

		<guid isPermaLink="false">http://www.twistedgenes.com/?p=257</guid>
		<description><![CDATA[This is how a video looks in ASCII.



How did we achieve it ?
- Login to a remote machine using ssh
- play a video using cvlc ( command line vlc )
- record the video using istanbul session recorder ( if u are in linux )
- convert it to mp4 format using ffmpeg
ffmpeg -i file.ogg -sameq  file.mp4
- [...]]]></description>
			<content:encoded><![CDATA[<p>This is how a video looks in ASCII.</p>
<p><center><br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/h8gpDaWPF2Q&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/h8gpDaWPF2Q&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
</center></p>
<p>How did we achieve it ?</p>
<p>- Login to a remote machine using ssh</p>
<p>- play a video using cvlc ( command line vlc )</p>
<p>- record the video using istanbul session recorder ( if u are in linux )</p>
<p>- convert it to mp4 format using ffmpeg</p>
<p>ffmpeg -i file.ogg -sameq  file.mp4</p>
<p>- Overlay the sound using ffmpeg and .mp3 of the same video. As in the sound would have played on remote machine and hence istanbul session recorder would not capture it.</p>
<p>ffmpeg -i file.mp4 -map 0.0 -i file.mp3 -map 1.0 -acodec copy -vcodec copy -ab 128k -ar 44100 file.mp4</p>
<p>- Crop the video, if you want to remove stuffs of your desktop before upload</p>
<p>ffmpeg -i output.mp4 -croptop 50 -cropbottom 50 output1.mp4</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twistedgenes.com/2009/11/video-in-ascii-using-vlc-ssh-and-refine-with-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Huntplace &#8211; The idea, reason and future</title>
		<link>http://www.twistedgenes.com/2009/11/huntplace-the-idea-reason-and-future/</link>
		<comments>http://www.twistedgenes.com/2009/11/huntplace-the-idea-reason-and-future/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 17:07:30 +0000</pubDate>
		<dc:creator>Rakesh</dc:creator>
				<category><![CDATA[Cool]]></category>
		<category><![CDATA[Experiences]]></category>
		<category><![CDATA[Rocking]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[all]]></category>
		<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://www.twistedgenes.com/?p=238</guid>
		<description><![CDATA[Travelling, excursions, adventures who doesn&#8217;t like them . A vast chunk of population likes to freak out on  small adventurous trips on weekends. The reason for this drive is to get rid of the mundane and mechanical cycle of office-home-offce and destress oneself. But the major question that arises is where to go? why this [...]]]></description>
			<content:encoded><![CDATA[<p>Travelling, excursions, adventures who doesn&#8217;t like them . A vast chunk of population likes to freak out on  small adventurous trips on weekends. The reason for this drive is to get rid of the mundane and mechanical cycle of office-home-offce and destress oneself. But the major question that arises is where to go? why this one and why not that one ? what kind of place is it ( historic, nature, modern etc).   How do we decide on this, googling and talking to colleagues. After all this exercise of mining tonnes of pages and talking to bunch of friends, the decision becomes more difficult. Differences of opinion starts among the group.</p>
<p><a href="http://www.huntplace.in" target="_blank">Huntplace</a> as the name suggests let&#8217;s you hunt for the place where you want to go . It basically aggregates/mines the data from resourceful and rich web applications like Flickr, Youtube, Wiki, etc. and makes your life easier. Instead of stumbling upon those stale and old sites, get the data from the popular and reliable sources. It is a mashup that calls the pulic APIs and let&#8217;s u explore your travel destination based on the content received.</p>
<p>The whole idea is in a very early phase and has been implemented. There are bunch of enhancements and ramifications that can be done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twistedgenes.com/2009/11/huntplace-the-idea-reason-and-future/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Navigation made easy</title>
		<link>http://www.twistedgenes.com/2009/02/nagigation-made-easy/</link>
		<comments>http://www.twistedgenes.com/2009/02/nagigation-made-easy/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 12:12:22 +0000</pubDate>
		<dc:creator>Rakesh</dc:creator>
				<category><![CDATA[Cool]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Navigation]]></category>

		<guid isPermaLink="false">http://www.twistedgenes.com/?p=202</guid>
		<description><![CDATA[With the advent of web, location base searching and driving directions have been of key importance as these form one of the integral needs of the time. There have been many key players viz. Google, Yahoo, Everyscape etc providing driving directions, routes on map, rich image experience etc. 
The latest addition to the field is video [...]]]></description>
			<content:encoded><![CDATA[<p>With the advent of web, location base searching and driving directions have been of key importance as these form one of the integral needs of the time. There have been many key players viz. Google, Yahoo, Everyscape etc providing driving directions, routes on map, rich image experience etc. </p>
<p>The latest addition to the field is video based direction, which is new and unique in its kind. Video Maps is the new terminology coined by the Bangalore based startup <a href="http://www.vidteq.com" target="_blank">Vidteq</a> . The key features include video for the complete route, location based services images etc.  Video based experience is beneficial for people on the move and who are new to  the city.<br />
<span></span><br />
<span> Vidteq on NEWS9 </span><br />
<span style='text-align:center' ><br />
<center><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/8qtZpv8X_Z0&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/8qtZpv8X_Z0&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
</center><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.twistedgenes.com/2009/02/nagigation-made-easy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A strikingly odd web application exposure</title>
		<link>http://www.twistedgenes.com/2008/12/a-strikingly-odd-web-application-exposure/</link>
		<comments>http://www.twistedgenes.com/2008/12/a-strikingly-odd-web-application-exposure/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 19:06:39 +0000</pubDate>
		<dc:creator>Rakesh</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Crazy]]></category>
		<category><![CDATA[Experiences]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[all]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Curl]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.twistedgenes.com/?p=124</guid>
		<description><![CDATA[Without having to expose your backend stuff to the internet, how do you service a WAP/WEB request. The blog below discusses a typical method of achieving the same. Assuming that whole web system is being developed in a intranet and not hosted outside. Let us call the internal unexposed server as A. We need a [...]]]></description>
			<content:encoded><![CDATA[<p>Without having to expose your backend stuff to the internet, how do you service a WAP/WEB request. The blog below discusses a typical method of achieving the same. Assuming that whole web system is being developed in a intranet and not hosted outside. Let us call the internal unexposed server as A. We need a server hosted on internet to fetch the WAP/WEB requests from the mobile or computer. This server is called as B. The request is being fired on the server B, the request is written to a flat file called request file. Server A runs a shell program viz fetchrequest.sh which reads the request file every second for any new requests coming  using the curl unix utility. Meanwhile, the server B sleeps off and waits for a response from server A. Server A will read the request and if its new (newness of a request is determined by saving the previous  request number in a global shell environment variable) server A processes it and shoots back the response to server B in the form of a file via FTP. Server B, in its sleeping state waits for the this FTP response file. Once recieved, it pushes back the response to the user. The whole wait process is scheduled for a fixed period of time, after which a dummy response is send like server is down, request failed, bla bla etc . Let us see how the same is achieved in fetchreques.sh running on server A.</p>
<p>File fetchrequest.sh</p>
<pre>
#!/bin/bash
while [ 10 -eq 10 ]

#Runs in a infinite loop checking request file at server B every second
do
if [ `env | grep -c lastCounter` = 1 ];then
newCounter=`curl -s http://serverB/requestFile.txt | tail -1 | cut -d: -f1`

#Reading request file at server B
param=`curl -s serverB/requestFile.txt | tail -1 | cut -d: -f2` #Extracting the request parameters
echo newCounter : $newCounter lastCounter : $lastCounter

#If there is a new request, sending a response back to the server B
if [ "$newCounter" != "$lastCounter" ]; then
echo "Need to send a response"
echo "Response URL : http://serverA/something.pl?action=something&amp;param1&amp;param2"

#Trimming of the response that needs to be send to serverB and storing it in a variable
output=`curl -s "http://serverA/something.pl?action=something&amp;param1&amp;param2" | grep 'cap\\|img' |
sed \ 's/&lt;src&gt;.*&lt;\/src&gt;//g;s/&lt;cap&gt;/\:/g;s/&lt;\/cap&gt;//g;s/&lt;img&gt;/\:/g;s/&lt;\/img&gt;//g'`
echo "Response received : $output"

#writing the response to a flat file to be FTPed to server B
`echo $output&gt;"rp_$newCounter.txt"`
`export filename==rp_$newCounter.txt`
`echo ls -l "rp_$newCounter.txt"`
typeset -i responseSize=`wc -c rp_$newCounter.txt | cut -d" " -f1`
echo "Response size $responseSize"

#If the process response is garbled, small or null, sending a dummy error in FTP file
if [ $responseSize = 1 ];then
`echo "We are working , try later" &gt; "rp_$newCounter.txt"`
fi

#making an FTP connection to serverB and launching the response file
`curl -s -T "rp_$newCounter.txt" -u username:password"ftp://serverB/rp_$newCounter.txt"`
echo "Uploaded the FTP file for $newCounter request"
`rm -f rp_$newCounter.txt`
echo "Deleting rp_$newCounter.txt after upload"

#Updating the request environment variable
lastCounter=$newCounter
export lastCounter
fi
else
lastCounter=`curl -s http://serverB/mobRequests.txt | tail -1 | cut -d: -f1`
export lastCounter
fi
done
</pre>
<p>The whole system works very well, and the requests are processed and response send to user. There are however limitations to this model.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twistedgenes.com/2008/12/a-strikingly-odd-web-application-exposure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SELinux, Apache and Postgres SQL Connectivity</title>
		<link>http://www.twistedgenes.com/2008/09/selinux-apache-and-postgres-sql-connectivity/</link>
		<comments>http://www.twistedgenes.com/2008/09/selinux-apache-and-postgres-sql-connectivity/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 23:31:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Experiences]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rocking]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://rak19.wordpress.com/2008/09/25/selinux-apache-and-postgres-sql-connectivity/</guid>
		<description><![CDATA[Recently, I decided to migrate the work from Apache windows to the Apache running on my Vmware fedora machine. Everything was supposed to work like a charm. Unfortunately, it did not. The perl  in the cgi-bin directory was throwing internal server error 500. The apache error log indicated &#8216;permission denied to create a socket&#8217;, [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align:justify;font-family:verdana;">Recently, I decided to migrate the work from Apache windows to the Apache running on my Vmware fedora machine. Everything was supposed to work like a charm. Unfortunately, it did not. The perl  in the cgi-bin directory was throwing internal server error 500. The apache error log indicated &#8216;permission denied to create a socket&#8217;, &#8216;premature end of the script headers&#8217;. The stuff was supposed to be retrieved from postgres sql database by the perl thingy. It appeared to me that database server is not allowing my IP address to establish a connection, as recomended by pgadmin as well. After a successful entry of my IP in the conf file of postgres database server, problem still persisted. I tried almost everything, changing the file owner to apache, suexec in apache and hell lots of other possibilities. Then in the trial process I noticed a small pop up in the corner of the window, SELinux denial. SELinux is an enhanced feature in Linux, that can put restrictions on your applications in apache making database connection, nmap, access to network filesystem and lots and lots more. After giving apache persmission to make database connections, the error was resolved and application ran smoothly.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.twistedgenes.com/2008/09/selinux-apache-and-postgres-sql-connectivity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQUID Proxy Server Authenticated Mode</title>
		<link>http://www.twistedgenes.com/2008/09/squid-proxy-server-authenticated-mode/</link>
		<comments>http://www.twistedgenes.com/2008/09/squid-proxy-server-authenticated-mode/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 00:45:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cool]]></category>
		<category><![CDATA[Crazy]]></category>
		<category><![CDATA[Experiences]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rocking]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://rak19.wordpress.com/2008/09/21/squid-proxy-server-authenticated-mode/</guid>
		<description><![CDATA[We run a squid proxy server at our two system network at home   in unauthenticated mode. I was just going through the squid logs at /var/logs/squid/access.log, and I saw few miscreant IPs eating up my network bandwith by using our proxy server. Then, I decided to tune up the authentication mode for squid proxy [...]]]></description>
			<content:encoded><![CDATA[<div align="justify"><span>We run a squid proxy server at our two system network at home <img src='http://www.twistedgenes.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  in unauthenticated mode. I was just going through the squid logs at /var/logs/squid/access.log, and I saw few miscreant IPs eating up my network bandwith by using our proxy server. Then, I decided to tune up the authentication mode for squid proxy server. Squid doesn&#8217;t have its authentication module and we need to us LDAP,PAM or NCSA. I came accross NCSA based authentication at http://www.cyberciti.biz/tips/linux-unix-squid-proxy-server-authentication.html. Given below. It worked very well in our case. </p>
<p><strong>Configure an NCSA-style username and password authenticatio</strong>n</p>
<p>I am going to assume that squid is installed and working fine.</p>
<p>Tip: Before going further, test basic Squid functionality. Make sure squid is functioning without requiring authorization <img src='http://www.twistedgenes.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br />Step # 1: Create a username/password</p>
<p>First create a NCSA password file using htpasswd command. htpasswd is used to create and update the flat-files used to store usernames and password for basic authentication of squid users.<br /># htpasswd /etc/squid/passwd user1<br />Output:</p>
<p>New password:<br />Re-type new password:<br />Adding password for user user1</p>
<p>Make sure squid can read passwd file:<br /># chmod o+r /etc/squid/passwd<br />Step # 2: Locate nsca_auth authentication helper</p>
<p>Usually nsca_auth is located at /usr/lib/squid/ncsa_auth. You can find out location using rpm (Redhat,CentOS,Fedora) or dpkg (Debian and Ubuntu) command:<br /># dpkg -L squid | grep ncsa_auth<br />Output:</p>
<p>/usr/lib/squid/ncsa_auth</p>
<p>If you are using RHEL/CentOS/Fedora Core or RPM based distro try:<br /># rpm -ql squid | grep ncsa_auth<br />Output:</p>
<p>/usr/lib/squid/ncsa_auth</p>
<p>Step # 3: Configure nsca_auth for squid proxy authentication</p>
<p>Now open /etc/squid/squid.conf file<br /># vi /etc/squid/squid.conf<br />Append (or modify) following configration directive:<br />auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd<br />auth_param basic children 5<br />auth_param basic realm Squid proxy-caching web server<br />auth_param basic credentialsttl 2 hours<br />auth_param basic casesensitive off</p>
<p>Also find out your ACL section and append/modify<br />acl ncsa_users proxy_auth REQUIRED<br />http_access allow ncsa_users<br />Make sure that you do not have any other http_access statement.  <br />Save and close the file.</p>
<p>Where,</p>
<p>  * auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd : Specify squid password file and helper program location<br />  * auth_param basic children 5 : The number of authenticator processes to spawn.<br />  * auth_param basic realm Squid proxy-caching web server : Part of the text the user will see when prompted their username and password<br />  * auth_param basic credentialsttl 2 hours : Specifies how long squid assumes an externally validated username:password pair is valid for &#8211; in other words how often the helper program is called for that user with password prompt. It is set to 2 hours.<br />  * auth_param basic casesensitive off : Specifies if usernames are case sensitive. It can be on or off only<br />  * acl ncsa_users proxy_auth REQUIRED : The REQURIED term means that any authenticated user will match the ACL named ncsa_users<br />  * http_access allow ncsa_users : Allow proxy access only if user is successfully authenticated.</p>
<p>Restart squid:<br /># /etc/init.d/squid restart</span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.twistedgenes.com/2008/09/squid-proxy-server-authenticated-mode/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Firebug, turned out to be a real bug</title>
		<link>http://www.twistedgenes.com/2008/09/firebug-turned-out-to-be-a-real-bug/</link>
		<comments>http://www.twistedgenes.com/2008/09/firebug-turned-out-to-be-a-real-bug/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 18:42:00 +0000</pubDate>
		<dc:creator>Rakesh</dc:creator>
				<category><![CDATA[Crazy]]></category>
		<category><![CDATA[Experiences]]></category>
		<category><![CDATA[Rocking]]></category>
		<category><![CDATA[Truth]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://rak19.wordpress.com/2008/09/09/firebug-turned-out-to-be-a-real-bug/</guid>
		<description><![CDATA[Firebug, an  addon for  the popular web browser firefox became a pain in the a** once at work. It helps you to monitor HTTP request &#8211; response, Web Design layout etc.  We were trying to make certain  changes  in our javascript file and review the changes.  Clear the private [...]]]></description>
			<content:encoded><![CDATA[<div style="font-family:&quot;text-align:justify;">Firebug, an  addon for  the popular web browser firefox became a pain in the a** once at work. It helps you to monitor HTTP request &#8211; response, Web Design layout etc.  We were trying to make certain  changes  in our javascript file and review the changes.  Clear the private data ( Ctrl-Shift-Delete), restart the browser,  we tried almost everything . Later on after breaking head for sometime, we found out that firebug maintains its own cache of all the images, js and other component files being loaded that needs to be cleared in the console and the net tabs. <br />
So folks, if you use firebug with firefox , better be watchful else keep scratching your head. <img src='http://www.twistedgenes.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
]]></content:encoded>
			<wfw:commentRss>http://www.twistedgenes.com/2008/09/firebug-turned-out-to-be-a-real-bug/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-4811008-2");
pageTracker._setDomainName(".twistedgenes.com");
pageTracker._trackPageview();
} catch(err) {}</script>