tag:blogger.com,1999:blog-20911516854571592972024-03-13T01:04:09.424-04:00No Good Tips & Tricksno.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.comBlogger3711000tag:blogger.com,1999:blog-2091151685457159297.post-88448223390976847732011-06-05T11:40:00.000-04:002011-06-05T11:40:55.623-04:00Using google-voice-dialout.agi With Asterisk, Sipgate And Google Voice<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjF1OH48bRuor2Rx2gF9FRYfjuAa0RTIUQb16WBDR89T3ifh7kApSygkpb1tK6Yg6WQuMdP0gVc8EgvMrR2_evqtAYqOB8VlmStfb9UxNGvMTrfBwyVqL5bLEa06oJCAR8DRpYUtqvpjqo/s1600/AsteriskGoogleVoiceSipgate.png" imageanchor="1" style="clear:right; float:right; margin-left:1em; margin-bottom:1em"><img border="0" height="275" width="275" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjF1OH48bRuor2Rx2gF9FRYfjuAa0RTIUQb16WBDR89T3ifh7kApSygkpb1tK6Yg6WQuMdP0gVc8EgvMrR2_evqtAYqOB8VlmStfb9UxNGvMTrfBwyVqL5bLEa06oJCAR8DRpYUtqvpjqo/s320/AsteriskGoogleVoiceSipgate.png" /></a></div><br />
<div dir="ltr" style="text-align: left;" trbidi="on"><div style="text-align: justify;"><a href="http://www.pmarks.net/">Paul Marks</a> has a neat Python AGI script for Asterisk - <a href="http://www.pmarks.net/posted_links/google-voice-dialout.agi">google-voice-dialout.agi</a> - that will login to your Google Voice account and place a call for you. This script is intended to allow you to place free outgoing calls from your home SIP phone (like a Cisco 7960 which is what I've got set up right now) using <a href="http://voice.google.com/">Google Voice</a> and <a href="http://www.google.com/gizmo5/">Gizmo5</a>. Mario has a <a href="http://supermario-world.blogspot.com/2010/06/google-voice-sip-solutions.html">bunch</a> of <a href="http://supermario-world.blogspot.com/2010/06/improvements-to-asterisk-dialplan.html">blog posts</a> explaining different ways of doing this including a simpler setup with <a href="http://supermario-world.blogspot.com/2010/11/asterisk-18-and-native-google-voice.html">Google</a> <a href="http://supermario-world.blogspot.com/2010/12/outbound-google-voice-dialing-proper.html">Talk</a>, using the Jabber/Jingle support in Asterisk 1.8. His dial-plan also includes bridging of your outbound call and Google Voice callback so you needn't answer the call back from Google Voice.</div><br />
<div style="text-align: justify;">Gizmo5 has since been acquired by Google and isn't accepting new sign-ups any more so if you didn't get an account earlier or need a second account to support a roommate or spouse's Google Voice number, you're out of luck there. However, there are other services available and I came across <a href="http://www.sipgate.com/">Sipgate</a> in this <a href="http://lifehacker.com/#%215349506/make-free-voip-calls-from-google-voice">Lifehacker post</a>.</div><br />
<div style="text-align: justify;">Sipgate has a help article that explains <a href="http://www.sipgate.com/faq/article/394/How_do_I_configure_Asterisk">how to set up Asterisk to work with their service</a>. Now, to make outgoing calls, I copied the basic dial plan for Asterisk from Mario's post with one little change to the Google Voice dialout script - change the value of <span class="inline-code">phoneType</span> to <span class="inline-code">2</span> instead of <span class="inline-code">7</span>. From what I can tell <span class="inline-code">2</span> is for regular numbers, <span class="inline-code">7</span> is for Gizmo5 numbers and <span class="inline-code">9</span> is for Google Talk.</div></div><br />
<div style="text-align: justify;">Credit: Recycle icon from <a href="http://www.obsidiandawn.com/earth-friendly-vectors-photoshop-gimp-brushes">Obsidian Dawn</a></div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com1tag:blogger.com,1999:blog-2091151685457159297.post-5544687637544951492011-02-27T18:42:00.000-05:002011-02-27T18:42:10.991-05:00Color Clock - Representing Time As A Hexadecimal Color Value<div dir="ltr" style="text-align: left;" trbidi="on"><div style="text-align: justify;">I came across a post in my Facebook feed today that linked to <a href="http://thecolourclock.co.uk/">The Colour Clock</a> by <a href="http://www.lookatjack.com/">Jack Hughes</a>. It's a pretty neat idea - the current time is translated into a hexadecimal color value and applied to the background of the page. So as the time changes, the background color of the page changes as well.</div><br />
<div style="text-align: justify;">The only thing is, it's in Flash so if you're on an iOS device, you won't be able to see it. Or if you'd like to pull it up on your web-enabled TV or other device that doesn't have Flash. So I spent my Sunday afternoon porting it over to JavaScript and this is what I have: <a href="http://colorclock.nogoodatcoding.com/">http://colorclock.nogoodatcoding.com</a>. Can you spot the original?</div><div style="text-align: justify;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><div class="polaroid-container" style="float:none;"><div class="polaroid-shadow"><div class="polaroid"><div class="polaroid-content-container"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1vx6_6_yGwdp9_0_rk56ZNIu1q8M2nsTm4M001gyMr3UNi_LHOfXq8ld66-JfIc0YBfxNCxymKK7-V3KQIAOcTR_PZ_MyVaY88wMSIUMmHIvvjl8PHpGabtTMr0tzC_KsSuo62EV68Y8c/s1600/ColorClockCompare.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="247" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1vx6_6_yGwdp9_0_rk56ZNIu1q8M2nsTm4M001gyMr3UNi_LHOfXq8ld66-JfIc0YBfxNCxymKK7-V3KQIAOcTR_PZ_MyVaY88wMSIUMmHIvvjl8PHpGabtTMr0tzC_KsSuo62EV68Y8c/s400/ColorClockCompare.png" width="400" /></a><br><br />
<span class="polaroid-caption">Will the real Color Clock please stand up?<br />It's the one on the left.</span></div></div></div><span class="tape top-right"> </span><span class="tape top-left"> </span></div></div><br />
<div style="text-align: justify;">I've tried to stay true to the original but among other things, my colors are just a little off, most likely because I'm calculating them differently. You can find <a href="http://nogoodatcoding.com/projects/colorclock">project details on my site</a>.</div><br />
<div align="justify" class="nogoodnotebox"><div align="justify" class="nogoodnoteboxcontent"><span class="nogoodicon"> </span>Cross-posted from <a href="http://blog.nogoodatcoding.com/2011/02/color-clock-representing-time-as.html">The No Good Blog</a></div><span class="footer"> </span></div></div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com1tag:blogger.com,1999:blog-2091151685457159297.post-80383252162245700562011-02-19T17:52:00.002-05:002011-02-19T17:54:50.675-05:00JDOM - getChild() Or getChildText() Returns null<div dir="ltr" style="text-align: left;" trbidi="on"><div style="text-align: justify;">If you're using <a href="http://www.jdom.org/" title="JDOM website">JDOM</a> for parsing XML in Java and you run into the problem that <span class="inline-code"><a href="http://www.jdom.org/docs/apidocs/org/jdom/Element.html#getChild%28java.lang.String%29" title="JavaDoc for JDOM Element#getChild() method">Element#getChild(String)</a></span> and <span class="inline-code"><a href="http://www.jdom.org/docs/apidocs/org/jdom/Element.html#getChildText%28java.lang.String%29" title="JavaDoc for JDOM Element#getChildText() method">Element#getChildText(String)</a></span> just keep returning <span class="inline-code">null</span>, here's a list of reasons why that might be happening:<br />
<ol><li>The node <i>really</i> doesn't exist!</li>
<li>The node is in a different namespace and you need to use the version of the method that also accepts the namespace: <span class="inline-code"><a href="http://www.jdom.org/docs/apidocs/org/jdom/Element.html#getChild%28java.lang.String,%20org.jdom.Namespace%29" title="JavaDoc for JDOM Element#getChild() method">Element#getChild(String, Namespace)</a></span> or <span class="inline-code"><a href="http://www.jdom.org/docs/apidocs/org/jdom/Element.html#getChildText%28java.lang.String,%20org.jdom.Namespace%29" title="JavaDoc for JDOM Element#getChildText() method">Element#getChildText(String, Namespace)</a></span>.</li>
<li>Most importantly, remember that these methods return <i>only immediate descendents</i> of a node! So if you're looking to get a node nested at the nth level, you will need to walk the tree to its parent and only then can you call <span class="inline-code">#getChild()</span> and actually get the child!</li>
</ol></div></div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com1tag:blogger.com,1999:blog-2091151685457159297.post-79353799518284793062011-02-12T12:13:00.003-05:002011-02-20T12:37:02.641-05:00Facebook created_time format in JSON response<div style="text-align: justify;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhh2Nwn3pykvS6ZQZXl1dtEIJkKAPa0w5BOh67290-Zpp-Arinz7FzhrGDlrSuRXbOTRKLDNmqHOeX6bYJA6Vxre_nfVbwQ2jUaR9i4Jh-suvR0tD754IkvZDc5VxDA32EGW5SW8cTSl1f_/s1600/facebook-social.jpg" imageanchor="1" style="clear:right; float:right; margin-left:1em; margin-bottom:1em"><img border="0" height="209" width="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhh2Nwn3pykvS6ZQZXl1dtEIJkKAPa0w5BOh67290-Zpp-Arinz7FzhrGDlrSuRXbOTRKLDNmqHOeX6bYJA6Vxre_nfVbwQ2jUaR9i4Jh-suvR0tD754IkvZDc5VxDA32EGW5SW8cTSl1f_/s320/facebook-social.jpg" /></a></div>I was trying to get relative times for Facebook posts for <a href="http://fbbash.nogoodatcoding.com/">fbbash</a>, using the time returned in JSON objects using the Facebook JavaScript SDK. The <span class="inline-code">created_time</span> looks something like <span class="inline-code">2011-02-12T11:58:46+0000</span></div><br />
<div style="text-align: justify;">The part before the '<span class="inline-code">T</span>' is the date in a '<span class="inline-code">YYYY-MM-DD</span>' format. And after is the time in '<span class="inline-code">HH:MM:SS</span>'. As far as I can tell, the trailing '<span class="inline-code">+0000</span>' is the timezone offset but I've only ever seen that value so I've made the assumption that you're getting times that are GMT more or less (or <a href="http://en.wikipedia.org/wiki/UTC">UTC</a> if you want to get technical).</div><br />
<div style="text-align: justify;">I found <a href="http://stackoverflow.com/questions/3349293/relative-time-function-in-js-for-format-yyyy-mm-ddthhmmss0000">this script on Stack Overflow</a> by <a href="http://stackoverflow.com/users/331032/no">no</a>, that converts this timestamp into a relative time string such as '<i>5 min ago</i>'. Unfortunately, despite what the comments on the script say, simply calling </div><pre class="brush:javascript">fuzzyFacebookTime('2011-02-12T11:58:46+0000'); //doesn't work!</pre>doesn't return the right value - instead, it gives back 'NaN years ago'.<br />
<br />
<div style="text-align: justify;">The easy fix to this problem is to change the timestamp you're passing to the function to the form <span class="inline-code">YYYY/MM/DDTHH:MM:SS+ZZZZ</span> i.e. change the hyphens (<span class="inline-code">-</span>) to slashes (<span class="inline-code">/</span>). That seems to work and you should get the correct string. So you can make the call<br />
<pre class="brush:javascript">fuzzyFacebookTime('2011-02-12T11:58:46+0000'.replace(/-/g,'/'));</pre></div><br />
<div style="text-align: justify;">Here's the script:<br />
<pre class="brush:javascript">var fuzzyFacebookTime = (function(){
fuzzyTime.defaultOptions={
// time display options
relativeTime : 48,
// language options
monthNames : ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
amPm : ['AM', 'PM'],
ordinalSuffix : function(n) {return ['th','st','nd','rd'][n<4 || (n>20 && n % 10<4) ? n % 10 : 0]}
}
function fuzzyTime (timeValue, options) {
var options=options||fuzzyTime.defaultOptions,
date=parseDate(timeValue),
delta=parseInt(((new Date()).getTime()-date.getTime())/1000),
relative=options.relativeTime,
cutoff=+relative===relative ? relative*60*60 : Infinity;
if (relative===false || delta>cutoff)
return formatTime(date, options)+' '+formatDate(date, options);
if (delta<60) return 'less than a minute ago';
var minutes=parseInt(delta/60 +0.5);
if (minutes <= 1) return 'about a minute ago';
var hours=parseInt(minutes/60 +0.5);
if (hours<1) return minutes+' minutes ago';
if (hours==1) return 'about an hour ago';
var days=parseInt(hours/24 +0.5);
if (days<1) return hours+' hours ago';
if (days==1) return formatTime(date, options)+' yesterday';
var weeks=parseInt(days/7 +0.5);
if (weeks<2) return formatTime(date, options)+' '+days+' days ago';
var months=parseInt(weeks/4.34812141 +0.5);
if (months<2) return weeks+' weeks ago';
var years=parseInt(months/12 +0.5);
if (years<2) return months+' months ago';
return years+' years ago';
}
function parseDate (str) {
var v=str.replace(/[T\+]/g,' ').split(' ');
return new Date(Date.parse(v[0] + " " + v[1] + " UTC"));
}
function formatTime (date, options) {
var h=date.getHours(), m=''+date.getMinutes(), am=options.amPm;
return (h>12 ? h-12 : h)+':'+(m.length==1 ? '0' : '' )+m+' '+(h<12 ? am[0] : am[1]);
}
function formatDate (date, options) {
var mon=options.monthNames[date.getMonth()],
day=date.getDate(),
year=date.getFullYear(),
thisyear=(new Date()).getFullYear(),
suf=options.ordinalSuffix(day);
return mon+' '+day+suf+(thisyear!=year ? ', '+year : '');
}
return fuzzyTime;
}());</pre>Image Credit: <a href="http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/">ThinkDiff.net</a></div><br />
<div align="justify" class="nogoodupdatebox"><span class="nogoodicon"> </span>UPDATE [1235 20 Feb 2011]: Added an image and fixed some formatting</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com4tag:blogger.com,1999:blog-2091151685457159297.post-30375120790263059572010-08-01T16:31:00.001-04:002010-08-01T16:34:56.558-04:00Garmin nüvi 255W Crashes On Choosing A Favorite POI<div align="justify"><div style="text-align: right;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Ka2ZavCrOm2tYDh8GkOsNoeQF9dXqnUg5JPfIxRHy2KGnsMMrw7XsdEgA8F3-DUSVbh3-Y-nMiGcaDxEe1HMpEw22dzwamy7lIgeM8aITh2JutdmKvAF6yK0igV2WvobXkCHJFrukPap/s1600/garmin-nuvi-255w.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Ka2ZavCrOm2tYDh8GkOsNoeQF9dXqnUg5JPfIxRHy2KGnsMMrw7XsdEgA8F3-DUSVbh3-Y-nMiGcaDxEe1HMpEw22dzwamy7lIgeM8aITh2JutdmKvAF6yK0igV2WvobXkCHJFrukPap/s200/garmin-nuvi-255w.jpg" alt="Garmin nüvi 255W GPS" title="Garmin nüvi 255W GPS" width="200" /></a></div></div>I recently bought a <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16858108345" target="_blank">recertified Garmin nüvi 255W GPS from NewEgg.com</a> - I've only had it a week and since I don't have a car yet, I've only tested it by using it on the bus and while walking; seems to be working fine so far.</div><br />
<div align="justify">Except for one thing – sometimes, when I selected a destination, the unit would inexplicably crash – it would just turn off. The first couple of times, I wrote it off as a random glitch and got the software update that was available at <a href="http://my.garmin.com/" target="_blank">myGarmin</a>. But that didn’t solve the problem.</div><br />
<div align="justify">I finally noticed that this only happened when I selected the entry for my home (saved in my favorites list). And it would only happen when I went through the steps really quickly. And when it did happen, the thumbnail for the entry hadn’t loaded completely on screen. That’s right, I had a photo of the apartment complex entrance set for this favorite POI.</div><br />
<div align="justify">So as it turns out, it seems that if you have a big image – mine is about 1.5 MB – you’ll likely have a problem. Reducing the size of the image or not associating a photo with the POI seems to fix the problem.</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com2tag:blogger.com,1999:blog-2091151685457159297.post-68493671067273226642010-05-24T19:52:00.001-04:002010-05-24T19:52:53.930-04:00Metapost: Style Updates<div style="text-align: justify;">Not much to report, just spent a while making minor changes to the look of blog posts - </div><ul style="text-align: justify;"><li>Code snippets now use the excellent <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter">SyntaxHighlighter by Alex Gorbatchev</a> (chances are you've seen this already, it's pretty popular, and with good reason!).</li>
<li>I've updated the CSS so error, warning, tip and note boxes are all styled. I also went back and updated the posts that were put up before I thought of these. If you want to see what these look like, take a look at the <a href="http://tipsandtricks.nogoodatcoding.com/2010/02/svnssh-with-tortoisesvn.html">TortoiseSVN with SVN+SSH post</a> or the Hacking the <a href="http://tipsandtricks.nogoodatcoding.com/2008/06/hacking-cisco-7940-ip-phone.html">Cisco 7940 IP Phone post</a>.</li>
<li>Some minor updates to content and to styles so that everything is more consistent</li>
</ul>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com4tag:blogger.com,1999:blog-2091151685457159297.post-37623297885499824352010-05-01T16:54:00.001-04:002010-05-01T16:56:57.818-04:00Fix for Sony DSC-S40 Blank White LCD Screen<div style="text-align: justify;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCKch77NcqMgL02POKH4hY1sdydktdD2h83ZOYZpoIbVAxSutAiygshsCe9hemgqY7GBQ8AR-YlICvd780q9xkYUL-OKQFDnOaeYuvclCooIPUqCIlIk0P0BQFxNwhyPc1RJNbPel9h6Tc/s1600/Sony-DSC-S40-Blank-White-LCD-Screen.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCKch77NcqMgL02POKH4hY1sdydktdD2h83ZOYZpoIbVAxSutAiygshsCe9hemgqY7GBQ8AR-YlICvd780q9xkYUL-OKQFDnOaeYuvclCooIPUqCIlIk0P0BQFxNwhyPc1RJNbPel9h6Tc/s320/Sony-DSC-S40-Blank-White-LCD-Screen.png" /></a><br />
A little while ago, I turned on my Sony DSC-S40 camera and it gave me quite a fright – the LCD viewfinder was completely white! Turning the camera off and back on and changing batteries didn’t help.</div><br />
<div style="text-align: justify;">So I decided to Google to see if there was something that could be done about it. As it turns out, <a href="http://www.pechorin.com/m/2006/07/26/Sony_DSCS40_white_LCD_screen_problem-268493.html" target="_blank">there’s a simple solution (posted by a <i>Bob Allen</i>)</a> which has helped a lot of owners and when I first read it, I thought it was a joke. The instructions read:<br />
<br />
1. Hold camera firmly in left hand <br />
2. Smartly rap front of camera with knuckles of right hand on the "Cyber-shot" logo.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ7-p1TAqfrIq4AJW8vnXq-Rjy9brEoJNBQZUkVuIt54ucAELN6GHymjCatvDEY30andy4pGq14x75zj30pS-nFIif5MO9BmgQS_TYcAps2uCBl2KMbEVvfK1Hd-7Ddfv6wkWJ8f5Saxcp/s1600/Sony-DSC-S40-Blank-White-LCD-Screen-Fix.png" imageanchor="1" style="clear:left; float: right; margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ7-p1TAqfrIq4AJW8vnXq-Rjy9brEoJNBQZUkVuIt54ucAELN6GHymjCatvDEY30andy4pGq14x75zj30pS-nFIif5MO9BmgQS_TYcAps2uCBl2KMbEVvfK1Hd-7Ddfv6wkWJ8f5Saxcp/s320/Sony-DSC-S40-Blank-White-LCD-Screen-Fix.png" /></a><br />
<br />
That’s it. Really. And it <i>does</i> work.</div><br />
<div style="text-align: justify;">According to <a href="http://www.camerahacker.com/Forums/DisplayComments.php?file=Digital%20Camera/Sony/DSCs-40_has_blank_white_screen" target="_blank">this discussion on Camera Hacker</a>, the underlying problem is that the LCD ribbon becomes loose and either pressing or tapping the panel at the right spot (the Cyber-shot logo) fixes the issue by pushing the connector back in place.</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com18tag:blogger.com,1999:blog-2091151685457159297.post-46698673575972749472010-04-24T17:17:00.009-04:002010-05-02T22:18:29.067-04:00Wikipedia Footnotes Bookmarklet And Greasemonkey Script<div align="justify">I’ve recently begun reading Lukas Mathis’ blog, <a target="_blank" href="http://ignorethecode.net/">ignore the code</a> – it’s pretty interesting and insightful. I usually read posts from within my feed reader and rarely actually visit a site, so I missed this neat script he has, which pops up a small ‘floating’ div when the reader hovers over the footnote superscript number. He explains why he does this as well as how on his post titled <a target="_blank" href="http://ignorethecode.net/blog/2010/04/20/footnotes/">Footnotes</a>. He's also modified his script to create a bookmarklet for <a href="http://daringfireball.net/">Daring Fireball</a>.</div><br />
<div align="justify">The first thing I thought was, <i>this would be pretty useful for Wikipedia articles</i>, where there are usually tons of citations and references. So I adapted the bookmarklet for Wikipedia. Now you probably wouldn’t want to load the bookmarklet for every Wikipedia page, especially if you really do read the citations often. So I’ve also modified the script for use with Greasemonkey.<br />
<br />
This is what you should get after you use either of these scripts:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a imageanchor="1" style="margin-left: 1em; margin-right: 1em;" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDskyEYrCvpcO-OzHTvuaWJi3n3sNbws2W0vQk74yYGdJcNC5u5Mgl_2Qmsfc4DxqOMA38evy6H_cWkrGnjuTTpRgi0aHyw3j5E5LhOup0PSVanyLbsXsMmEDpJZdKACGDgUMgecpiQ73c/s1600/wikipediacitepopup-in-action.gif"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDskyEYrCvpcO-OzHTvuaWJi3n3sNbws2W0vQk74yYGdJcNC5u5Mgl_2Qmsfc4DxqOMA38evy6H_cWkrGnjuTTpRgi0aHyw3j5E5LhOup0PSVanyLbsXsMmEDpJZdKACGDgUMgecpiQ73c/s1600/wikipediacitepopup-in-action.gif" /></a></div><br />
You’ll find both scripts <a target="_blank" href="http://nogoodatcoding.com/projects/wikipedia-footnote-popup-script" >on the project page on my site</a> (along with some basic instructions on setup). Or if that’s too many page views in a day for you, <a target="_blank" href="javascript:(function(){(function(){var%20sups=document.getElementsByTagName('sup');var%20footnotehtml=[];window.footnoteinuse=false;for(var%20i=0;i<sups.length;i++){var%20sup=sups[i];if(sup['id']){if(!sup.childNodes[0])continue;var%20child=sup.childNodes[0];if(!child['href'])continue;var%20hrefValue=child['href'];var%20footnr=hrefValue.substr(hrefValue.indexOf('#')+1);var%20footnote=document.getElementById(footnr);if(!footnote)continue;footnotehtml[i]=footnote.innerHTML;sup.setAttribute('footnoteindex',i);sup.addEventListener('mouseover',function(event){window.footnoteinuse=false;var%20footnotepopup=document.getElementById('footnotepopup');if(footnotepopup)footnotepopup.parentNode.removeChild(footnotepopup);var%20index=parseInt(this.getAttribute('footnoteindex'));var%20popup=document.createElement('div');popup.innerHTML=footnotehtml[index];popup.id='footnotepopup';popup.style.position='absolute';popup.style.left=(event.pageX-50)+'px';popup.style.top=(event.pageY+10)+'px';popup.style.width='auto';popup.style.textAlign='left';popup.style.backgroundColor='#F9F9F9';popup.style.border='1px%20solid%20#636363';popup.style.padding='10px';popup.style.zIndex='99';popup.className='references-small';popup.addEventListener('mouseover',function(event){window.footnoteinuse=true;},true);popup.addEventListener('mouseout',function(event){window.footnoteinuse=false;var%20footnotepopup=document.getElementById('footnotepopup');window.setTimeout(function(){if(footnotepopup&&!window.footnoteinuse&&footnotepopup.parentNode){footnotepopup.parentNode.removeChild(footnotepopup);}},150);},true);document.body.appendChild(popup);var%20footnotepopup2=document.getElementById('footnotepopup');},true);sup.addEventListener('mouseout',function(event){var%20footnotepopup=document.getElementById('footnotepopup');window.setTimeout(function(){if(footnotepopup&&!window.footnoteinuse&&footnotepopup.parentNode){footnotepopup.parentNode.removeChild(footnotepopup);}},150);},true);}}})();})();" >this is the bookmarklet which you should bookmark</a>, and <a target="_blank" href="http://userscripts.org/scripts/source/75187.user.js" >this is a direct link to install the Greasemonkey script from userscripts.org</a>.</div><br />
<div align="justify">The idea and most of the code, are both courtesy Lukas; I’ve only tweaked it a bit for use with Wikipedia. Any mistakes are mine. And JavaScript isn’t really my forte so the code is probably not as elegant as it could be. All the same, it works for me (the bookmarklet on Firefox and Chrome; the GM script on Firefox <strike>only, of course</strike> and Chrome 4. IE, with it’s <a href="http://robertnyman.com/2008/11/04/internet-explorer-8-fix-event-handling-or-dont-release-it/" target="_blank">non-standard event handling</a> isn’t supported); if you do have some problems getting it to work, let me know.</div><br />
<div align="justify" class="nogoodupdatebox"><span class="nogoodicon"> </span>UPDATE [0006 01 May 2010]: Wow! The script was featured on everybody's favorite productivity and tips site <a href="http://lifehacker.com/5525590/wikipedia-footnote-displays-sources-by-mousing-over-footnotes" >Lifehacker</a>, and I've been so busy with <a href="http://en.wikipedia.org/wiki/Dead_week" >dead week</a>, that I didn't even notice! That explains the 507 installs in one day!<br />
<br />
<span class="nogoodicon"> </span>UPDATE [2210 02 May 2010]: <a href="http://blog.chromium.org/2010/02/40000-more-extensions.html">Chrome 4 supports Greasemonkey scripts natively</a> and most scripts should work properly; this one in particular does!</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com6tag:blogger.com,1999:blog-2091151685457159297.post-61268060928752417082010-02-12T23:13:00.013-05:002010-05-22T23:10:30.191-04:00SVN+SSH With TortoiseSVN<div align="justify" class="nogoodtipbox"><span class="nogoodicon"> </span>This HOWTO was compiled using the information at <a href="http://tortoisesvn.net/ssh_howto">http://tortoisesvn.net/ssh_howto</a> and <a href="http://www.walkernews.net/2009/03/22/how-to-fix-server-refused-our-key-error-that-caused-by-putty-generated-rsa-public-key/">http://www.walkernews.net/2009/03/22/how-to-fix-server-refused-our-key-error-that-caused-by-putty-generated-rsa-public-key/</a></div><br />
<div align="justify">First, a quick introduction to what's going on, if you haven't used SSH with keys before. The idea of using keys is to avoid using passwords - instead, your public key is on the server and when you connect, you identify yourself with your private key (which, as the name suggests, should only be available to you). You can read details of how it works and what it involves over at <a href="http://sshkeychain.sourceforge.net/mirrors/SSH-with-Keys-HOWTO/SSH-with-Keys-HOWTO-3.html">http://sshkeychain.sourceforge.net/mirrors/SSH-with-Keys-HOWTO/SSH-with-Keys-HOWTO-3.html</a>.</div><br />
<div align="justify"><b>A. Get your public and private keys</b> <br />
<ol><li>Login to the machine to which you’ll be connecting (the host where the SVN server is running).</li>
<li>Generate a key secured by a 1024-bit passphrase and the name <i>mykey</i> using the command <span class="inline-code">ssh-keygen -b 1024 -t dsa -N <i><b>passphrase</b></i> -f mykey</span> (replace <b><i>passphrase</i></b> with an actual passphrase of your choice – it needn’t be the same as your account password; in fact, it might make sense for it not to be).</li>
<li>The files <span class="inline-code">mykey</span> and <span class="inline-code">mykey.pub</span> will be created – the private and public keys respectively.</li>
<li>In your home directory, create a new directory named <span class="inline-code">.ssh</span> – and use the command <span class="inline-code">chmod 700 .ssh</span> to set the appropriate permissions on that folder.</li>
<li>Copy the public key to this folder and rename it to authorized_keys (<span class="inline-code">cp mykey.pub /<b><i>home-directory</i></b>/.ssh/authorized_keys</span>) and then set the appropriate permissions (<span class="inline-code">chmod 600 authorized_keys</span>). In older implementations, <span class="inline-code">authorized_keys2</span> was the name used for the key.</li>
<li>Copy the private key (<span class="inline-code">mykey</span>) to the machine where you’ll make the connection (the client where TortoiseSVN will be used)</li>
</ol></div><div align="justify"><b>B. Test the connection with <a href="http://www.chiark.greenend.org.uk/%7Esgtatham/putty/" target="_blank">PuTTY</a>, PuTTYgen and Pageant</b> <br />
<ol><li>The problem here is that the key generated on the host isn’t directly usable by PuTTY; it must be converted using PuTTYgen. Use <span class="inline-code">Conversions > Import key</span> to import your private key (<span class="inline-code">mykey</span>) and then <span class="inline-code">Save private key</span> as <span class="inline-code">mykey.ppk</span> (or whatever you prefer). </li>
<li>In PuTTY, create a new session with mykey.ppk as the private key under <span class="inline-code">SSH > Auth > Private key file for authentication</span> </li>
<li>Try to connect – if you’ve not specified the username as part of the the host name (in the form <span class="inline-code">username@host</span>), you’ll be prompted for the username but not for the password. You should see something like <br />
<pre class="brush: plain">Using username "username".
Authenticating with public key "imported-openssh-key" from agent
Last login: Fri Feb 12 17:21:41 2010 from c-99-250-91-125.hmd2.ca.comcast.net</pre></li>
<li>Once you’ve verified that your key works, you can optionally begin using Pageant instead to save your keys (perhaps for multiple user names) instead of specifying a key within the session details – choose to <span class="inline-code">Add Key</span>, select the private key and specify the passphrase for it – they key should be added to your list.</li>
<li>Try to connect via PuTTY, except this time, remove the private key from <span class="inline-code">SSH > Auth > Private key file for authentication</span> – PuTTY should then use the key details from Pageant.</li>
</ol><div align="justify" class="nogoodtipbox"><span class="nogoodicon"> </span>To avoid having TortoiseSVN (or PuTTY) prompt you for the username when connecting, you can use the form <span class="inline-code">username@host/repo-path</span> to attempt the connection with the login <span class="inline-code">username</span>.</div></div><br />
<div align="justify"><b>C. Connecting with TortoiseSVN</b> <br />
You can specify different ways to tell TortoiseSVN how to connect to your repository – by giving the name of the PuTTY connection you created above or by using Pageant; I used Pageant <br />
<ol><li>Make sure you’ve got Pageant running and have imported the key as described above. </li>
<li>The repository URL should be of the form <span class="inline-code">svn+ssh://<b><i>hostname</i></b>/repo-path</span>. For a PuTTY connection, the URL <span class="inline-code">svn+ssh://<b><i>PuTTY-Connection-Name</i></b>/repo-path</span> is supposed to be used. </li>
<li>This should be enough to connect to the SVN server. </li>
</ol></div><br />
<div align="justify" class="nogoodtipbox"><span class="nogoodicon"> </span>If you keep getting a dialog titled TortoisePlink that asks you to 'login as', then you're probably seeing the bug described at <br />
<a href="http://old.nabble.com/Bug-with-TortoisePlink-td18812277.html">http://old.nabble.com/Bug-with-TortoisePlink-td18812277.html</a>. The workaround that the poster described is to clear the value for the registry key <span class="inline-code">HKEY_CURRENT_USER > Software > SimonTatham > Putty > Sessions > Default Settings > HostName</span>.<br />
<br />
Apparently if there is a hostname specified in the default connection in PuTTY, this problem manifests itself. Even if you don't see any value in the PuTTY interface, you should clear the key in the registry.<br />
<br />
<div align="justify" class="nogoodwarningbox"><span class="nogoodicon"> </span>As always, be warned that editing the registry is fraught with danger, so backup and think twice before changing anything.</div></div><br />
<div align="justify" class="nogoodnotebox"><div align="justify" class="nogoodnoteboxcontent"><span class="nogoodicon"> </span>If you're not using keys, you'll probably see the dialogs asking for username and password pop-up over and over - with the repository I'm connecting to, I have to authenticate thrice when I first try to browse the repository and subsequently, once more for every new directory I select. So it seems like a new connection is setup for every request but I'm not sure.</div><span class="footer"> </span></div><br />
<div align="justify" class="nogoodupdatebox"><span class="nogoodicon"> </span>UPDATE [1630 18 Feb 2010]: I'd mixed up the permissions for the .ssh folder and the authorized_keys file. Also added some more information and a fix for the TortoisePlink 'login as' dialog.</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com7tag:blogger.com,1999:blog-2091151685457159297.post-4599553384964290812009-12-18T21:01:00.008-05:002010-05-22T23:07:43.948-04:00Samurize Config For NextBus<div style="text-align: justify;"><a href="http://nextbus.com/">NextBus</a> is a pretty awesome service but it's a pain to load up the website everytime to look up the next arrival time. The site does have bookmarkable URLs and the pages do reload automatically. But if left open the page usually times out after a few reloads. And personally, I don't like leaving tabs open in the browser for too long, it just seem untidy and unnecessary, not to mention RAM usage.</div><br />
<div style="text-align: justify;">I use <a href="http://samurize.com/">Samurize</a> to embed a lot on information in 'always-on-top' panels so that I can see things like the time in 2-3 cities, the current temperature and weather conditions in my city, CPU and RAM usage, currency rates etc, all in a glance. But I couldn't find a script or plug-in that would pull the data for NextBus and NextBus doesn't have an API or even an RSS feed. I finally had some time on my hands, now that the semester has come to an end and I put together a quick-and-dirty script (in VBScript) to get the next two arrival times for a bus.</div><br />
<div style="text-align: justify;">Now, I didn't have the patience to write something to parse the whole page - it's pretty messy and there's no ids or names that would make working with the HTML easier. So for now, the script is a hack that takes advantage of the fact that the page contains a block of JavaScript that sets the title of the window to the next two arrival times. So reading that and getting the time was pretty easy and works for now, at least.</div><br />
<div style="text-align: justify;">You can find more details at <a href="http://www.nogoodatcoding.com/projects/nextbus-scraper">http://www.nogoodatcoding.com/projects/nextbus-scraper</a>. There is also a sample Samurize config, distributed as a <span class="inline-code">.sam</span> package. Here's what you should see if you use it:</div><br />
<div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjokqikupp2t5isfC0g0z5WBDbBV0s25_V2T9xz9zi9JNl8xuSVrXRwSOnd6GbQJFaDAxvZUS_ZbbeErUVErqlPWscjEVhVmffJVVhZnlMNdcEeEsCzibp8IvAyi-woIHWcZ82tXjdQdDDv/s1600-h/NextBus-Samurize-Config.png"><img style="cursor:pointer; cursor:hand;width: 285px; height: 221px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjokqikupp2t5isfC0g0z5WBDbBV0s25_V2T9xz9zi9JNl8xuSVrXRwSOnd6GbQJFaDAxvZUS_ZbbeErUVErqlPWscjEVhVmffJVVhZnlMNdcEeEsCzibp8IvAyi-woIHWcZ82tXjdQdDDv/s400/NextBus-Samurize-Config.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5416767616397554834" /></a></div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com1tag:blogger.com,1999:blog-2091151685457159297.post-1026355534253563022009-11-08T20:04:00.003-05:002010-05-22T23:04:53.607-04:00jCIFS TransportException: Invalid payload size: 254<div style="text-align: justify;">I was looking into <a href="http://jcifs.samba.org/" title="jCIFS website">jCIFS</a> for adding shared network folder support for <a href="http://folder2feed.nogoodatcoding.com/" title="Folder2Feed website">Folder2Feed</a>. I had a snippet of code that I had tried out quite some time back which simply listed all shared folders on a particular machine and this had worked for my PC and for the Mac. However, when I tried to run this demo code against the Mac after a few weeks with a new release, I got the following exception:<br />
</div><br />
<pre class="brush: plain">jcifs.util.transport.TransportException
java.io.IOException: Invalid payload size: 254</pre><br />
<div style="text-align: justify;">I didn't really investigate this because of other commitments. But a friend of mine who was also checking it out finally figured out the problem. With the earlier releases, the property <span class="inline-code">jcifs.smb.client.useExtendedSecurity</span> defaulted to <span class="inline-code">false</span>. But with the newer releases, it defaults to <span class="inline-code">true</span>. Explicitly setting it to <span class="inline-code">false</span> fixes the problem.</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com1tag:blogger.com,1999:blog-2091151685457159297.post-19866803687294177212009-04-27T12:30:00.011-04:002010-05-08T22:41:44.381-04:00Controlling Your Home Web Server Content Remotely Using Dropbox<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAyuxVpJ3ngWayebUOczU-UBl6QyULXzBzcwpx4SW9JtL547bxP4RmKGCvzoBBaB5jXg89_bZ9b1vGWGOVZJ8ml8DxaEwX2vNJW2dqYo6HeTYgy2HWTuPlfgL1FF3ag59kwGCNc1SngcI9/s1600-h/Remote-Webserver-Control.jpg"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 144px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAyuxVpJ3ngWayebUOczU-UBl6QyULXzBzcwpx4SW9JtL547bxP4RmKGCvzoBBaB5jXg89_bZ9b1vGWGOVZJ8ml8DxaEwX2vNJW2dqYo6HeTYgy2HWTuPlfgL1FF3ag59kwGCNc1SngcI9/s320/Remote-Webserver-Control.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5329410584644017810" /></a><br />
<div style="text-align:justify">I have a home server (using <a href="http://tomcat.apache.org" title="Apache Tomcat website">Tomcat</a>) that I use for some stuff like sharing files with family and friends and getting feedback on some web-based stuff. Recently, I was creating the website for <a href="http://folder2feed.nogoodatcoding.com" title="Folder2Feed website">Folder2Feed</a> (a Java app that generates feeds from folders) and I was tweaking some CSS bits after hours at office. I wanted to check with some friends about the look and these were my options:<br />
<br />
<ol><li>Send the files to each person using an IM client</li>
Cons:<ul><li>The receiver would need to be competent enough to understand what to do with the files I was sending</li>
<li>I'd have to send the files to each person</li>
<li>The other person needs to be online at the time</li>
<li>Not every workplace allows IMs</li>
<li>Resuming broken downloads isn't usually possible</li>
</ul><li>Use VNC to connect to my home machine and then put the updated content in the web server folders</li>
Cons:<ul><li>It's a slow and tedious process over VNC</li>
<li>Doing this over and over for small changes is a major pain</li>
<li>Not every workplace would be setup to use VNC</li>
</ul><li>Wait until I got home</li>
Cons:<ul><li>I'd have to wait</li>
<li>I'd have to remember to take the files home with me (I always forget!)</li>
</ul></ol><br />
All of these are pretty viable options but where's the geek cred? Alright, so VNC does have some but still, it's painful for regular use over a slow connection. I have been using <a href="http://getdropbox.com" title="Website for Dropbox - secure sycing, backup and sharing">Dropbox</a>, which is an <em>awesome</em> service. It's free, painless to setup and so simple, even your most technophobic friends will be able to use it. So I figured that if I could setup a way to update my web server using Dropbox, I'd be in business. The easiest way to do that would be to move my web server installation into the Dropbox folder but that would be overkill. I didn't need the complete web server setup to be shared and synced, only one particular webapp I was running on it.<br />
<br />
Now there's this concept of <a href="http://en.wikipedia.org/wiki/Virtual_hosting" title="Wikipedia entry for virtual hosting">vHosts</a>, wherein a single physical server can host multiple websites. For example <a href="http://nogoodatcoding.com">nogoodatcoding.com</a> and nogoodatcoding.org could both be on the same server but that would not be readily apparent to a visitor. Most modern web servers should support vHosts - Tomcat and Apache certainly do. The one that would probably be more commonly used is name-based and that is what is used in the instructions below.<br />
<br />
So coming to the crux of this post - <strong>you can simply add a vHost to your web server and point it to a folder inside your Dropbox home and voila! You have complete control over the content you're hosting!</strong><br />
<br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span>I use <a href="http://dyndns.com" title="Free dynamic DNS from DynDns.com">DynDNS</a> and <a href="http://no-ip.com" title="Free dynamic DNS from NO-IP.com">NO-IP</a> for my dynamic DNS needs and all I had to do there was add another hostname and point it to the same machine.</div><span class="footer"> </span></div><br />
Here's how you can do it for Tomcat:<ol><li>Browse to <span class="inline-code">$CATALINA_HOME/conf</span> and edit <span class="inline-code">server.xml</span>.</li>
<li>You'll find a block of code that defines the default vHost - localhost:<br />
<pre class="brush: xml"><Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false"></pre>You can leave this untouched.</li>
<li>Add another host, something like<br />
<pre class="brush: xml"><Host name="myDynDNSHostNameForDropbox.dyndns.biz" appBase="c:\\My Dropbox\\My vHost Content"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false"></pre></li>
<li>Restart the server and you should be good to go.</li>
</ol><br />
You can find more about configuring Tomcat for vHosts at the official website: <a href="http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html" title="Official Tomcat documentation on virtual hosts">Virtual Hosting and Tomcat</a><br />
<br />
For doing the same with the Apache Web Server (version 2.2; for older ones you should locate the appropriate documentation and tutorials):<ol><li>Edit your <span class="inline-code">httpd.conf</span> and uncomment the line for virtual hosts:<br />
<span class="inline-code">#Include conf/extra/httpd-vhosts.conf</span></li>
<li>Edit <span class="inline-code">conf/extra/httpd-vhosts.conf</span> and set it to something like:<br />
<pre class="brush: xml">NameVirtualHost *:80
#This will maintain your current configuration for all names except the second vHost
<VirtualHost *:80>
ServerName localhost
#This is the relative path to the htdocs directory
DocumentRoot htdocs
</VirtualHost>
#This vHost will answer for requests to myDynDNSHostNameForDropbox.dyndns.biz
<VirtualHost *:80>
ServerName myDynDNSHostNameForDropbox.dyndns.biz
#The absolute path to the directory for this hosts content
DocumentRoot "c:\\My Dropbox\\My vHost Content"
</VirtualHost>
#This apparently is required for overriding the default security; otherwise you'll be denied access
<Directory "c:\\My Dropbox\\My vHost Content">
Order Deny,Allow
Allow from all
</Directory></pre></li>
<li>Restart the server and you should be good to go.</li>
</ol><br />
I'm not really an Apache user, I tend to stick with Tomcat. I got this information from the offical Apache docs: <a href="http://httpd.apache.org/docs/2.2/vhosts/" title="Apache Virtual Host documentation">Virtual Hosting with Apache</a>, <a href="http://httpd.apache.org/docs/2.2/vhosts/name-based.html" title="Name based virtual hosting with Apache">Name based virtual hosting with Apache</a> and <a href="http://apptools.com/phptools/virtualhost.php" title="Apache Virtual Hosting tutorial">this great tutorial on Apache Virtual Hosting</a>.<br />
<br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span>It's pretty much the same technique for any webserver that supports vHosts and you should find the documentation for yours and check what needs to be done.</div><span class="footer"> </span></div><br />
Once you've set this system up, you'll be able to simply modify files in your locally synced folders under Dropbox and the changes will be reflected in a few moments on your home webserver! You could use this to put up pretty much anything on your webserver - a photo you just clicked at work, a document you want to put up to share with a friend or even some collaborative work on one single webpage or anything else!</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com1tag:blogger.com,1999:blog-2091151685457159297.post-8438941686351564322009-03-06T12:02:00.001-05:002010-05-22T22:22:47.291-04:00Linking PayMate To Your ABN AMRO Bank Account<div align="justify">I'd got a <a href="http://en.wikipedia.org/wiki/PayMate" title="Wikipedia entry for PayMate">PayMate</a> (not to be confused with <a href="http://en.wikipedia.org/wiki/Paymate" title="Wikipedia entry for Paymate">Paymate</a>, the Australian equivalent of PayPal) a year or so ago. I don't really use it very frequently except that I'd got a few free coupons so I'd bought stuff with those.<br />
<br />
Recently, in my ABN AMRO netbanking account, I noticed a link that read <em>Click here to register for payment service through Mobile 'PAYMATE'</em> [sic]. This sounded interesting since, usually, I'd come across stuff on the online shopping sites that cost just a little bit more than my coupon was worth. Or there'd be extra charges for shipping. I figured that if I could associate my bank account with PayMate (for example, with PayPal, you can add additional sources but the money in your PayPal account gets used up first. So you never run out of funds, but you also don't end up with a trifling balance in your PayPal account), then I'd be able to tap into those funds for the remainder of any purchase requirement, over and above the coupon value.<br />
<br />
I needed to confirm this of course, so I called up ABN AMRO's customer care helpline. Not a very good idea. Those people weren't clear on what PayMate was themselves and even when I tried to make them understand that I had been using PayMate for over a year and I knew what it was, they insisted on trying to explain the PayMate service to me. Sigh!<br />
<br />
Now don't get me wrong, the representatives are usually pretty helpful and I do like ABN AMRO's service. Except in this case, they had no idea about it and had probably not been trained well enough on the topic. Anyway, I'd read somewhere that instead of venting your ire on some poor phone jockey, who probably wouldn't be able to do anything about it anyway, and spoiling your and his/her day, it's better to say 'thank you', put the phone down, and dial in again, hoping you get someone better equipped to help you.<br />
<br />
I tried that but to no avail. The next day, I called up PayMate directly and, finally, someone was able to tell me how this thing would work. So here it is, what you've (hopefully) been reading this post for - how would you use your ABN AMRO account with your PayMate account? How will it work?<br />
<br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span>If you don't know how PayMate works, you should read their <a href="http://www.paymate.co.in/web/faq.aspx" title="The PayMate FAQ page">FAQ</a> first.</div><span class="footer"> </span></div><br />
Your phone number is your PayMate id, of course. For every bank account (or other source of funds) linked to PayMate (they plan to add others later), you will get a <em>new</em> PIN. This is in addition to the PIN you may have for your original PayMate account (if you do have one). When you make an online transaction, <em>the PIN you authorize the transaction with will determine which source of funds is utilized</em>.<br />
<br />
So there is no question of using up any one source first and then seamlessly switching over to the next preferred source. The source you pick <em>must</em> have sufficient funds.<br />
<br />
Too bad. I was hoping for a PayPal like model, I'd probably have used PayMate more often then. They just might introduce this feature though so it's probably good to wait and watch.</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com3tag:blogger.com,1999:blog-2091151685457159297.post-72391811815130571232009-02-25T00:20:00.006-05:002010-05-22T22:19:10.310-04:00Using A Virtual Credit Card WIth PayPal - Not Possible Anymore<div align="justify">When I bought my domain, almost two years ago, I didn't want to use my credit card (I'm paranoid that way :) ). I looked about a bit and I found out that <a href="https://paypal.com">PayPal</a> would allow you to use 'virtual' cards that some banks offer. These are one-time usage cards that have some user-imposed limit. By using these cards, which will expire after use (or if unused within certain time-frame), you're safer when participating in online transactions since you don't expose your physical card details.<br />
<br />
Anyway, I had an HDFC account and I'd signed up for the <a href="http://www.hdfcbank.com/personal/payments/netsafe/netsafe.htm">NetSafe cards</a> facility. So I also signed up for PayPal and registered a virtual card. Now PayPal had (has?) this thing where your account needed to be verified. A certain amount of money ($1.95 at last check) is deducted from your card and the transaction details have a 4 digit pin (which appears immediately in the transaction details for the virtual card) which you then need to enter in a form in PayPal to prove that you indeed own the card and are not running some sort of scam. After this account verification, you were free to use your card for further transactions. Except that I registered a virtual card which was now invalid after the verification transaction. So I generated another card and added that to my PayPal account and I was good to go.<br />
<br />
Yesterday, I was trying to buy a new domain name. I tried doing the same thing I'd done earlier but my transaction kept getting declined. On closer inspection, I saw that PayPal was now asking me to verify my <em>card</em>! This meant that <em>every</em> card you now add to your PayPal account needs to go through the verification process. Which spells doom for virtual card users since the card would be invalid after the verification transaction!<br />
<br />
I'm not quite sure when or why this happened, I'm not a frequent user of PayPal; I only registered because <a href="http://godaddy.com">GoDaddy</a>, my registrar, had the option for payments via PayPal and PayPal could be used with virtual cards. Well, not anymore! Finally, I ended up registering my actual credit card (luckily for me, I'm also subscribed to alerts via SMS so I received my transaction code almost immediately, instead of having to wait for a couple of days for it to show up in my online transaction list) and using that to make my purchase.</div><br />
<div class="nogoodwarningbox">Disclaimer: This information isn't an official announcement from any of the parties mentioned. It's what I figured out after trying out a few things with my account; make sure you've read up on whatever it is that you want to do with your virtual card and/or PayPal account.</div><br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span>If you're a HDFC bank account holder and are having troubles with NetSafe, check out <a href="http://www.blog.jbi.in/internet/creating-a-vcc-using-hdfc-netsafe-service/" title="Tutorial on how to use NetSafe">this well-written post with screenshots</a>.</div><span class="footer"> </span></div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com9tag:blogger.com,1999:blog-2091151685457159297.post-5033122222334369502009-02-19T01:37:00.009-05:002010-05-22T22:21:03.384-04:00Folder2Feed<div style="text-align: justify;">If you've ever wanted to monitor a folder for changes but have realized that it's too tedious to remember to check the contents or to even figure out which files or folders are new then you could give <a href="http://folder2feed.nogoodatcoding.com/">Folder2Feed</a> a try.<br />
<br />
It's a Java application that can be configured to monitor a folder and generate a feed (RSS or Atom) of the newest files in that location. It's still work in progress but the basic command line interface version is out. I plan to add a GUI to it soon, work permitting, of course. There are also some other features that I think should be there and I'll be working on them. If you have any suggestions for features, consider leaving me a comment here or <a href="http://apps.sourceforge.net/trac/folder2feed/newticket" title="Link to the Folder2Feed Bug Tracker">on the bug tracker</a> (choose <span class="inline-code">feature request</span> under <span class="inline-code">Type</span> and if possible, leave your email id so I can get back to you if needed).<br />
<br />
If you find any bugs, do report them, I'd like to make Folder2Feed better.<br />
<br />
For any feedback, mail me at <strong><em>folder2feed[AT]nogoodatcoding[DOT]com</em></strong> (replace [AT] and [DOT] with the appropriate symbols).</div><br />
<div class="nogoodupdatebox"><span> </span>UPDATE [21 Feb 2009]: I've activated Trac for bug tracking, so the link has been changed.</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com0tag:blogger.com,1999:blog-2091151685457159297.post-25675318676729087532009-02-11T11:13:00.005-05:002010-05-22T22:14:14.905-04:00Unhandled Win32 Exception Crashes Firefox After Installing Microsoft Visual Studio 2005 (Just In Time Debugger)<div style="text-align: justify;">The other day I installed Visual Studio 2005 Pro on my machine at office. A little later, I started Firefox and got this error from the Visual Studio Just In Time Debugger:<br />
<br />
<span class="inline-code">An unhandled win32 exception occurred in firefox.exe</span><br />
<br />
I Google'd it and I came across <a href="http://support.mozilla.com/tiki-view_forum_thread.php?forumId=1&comments_parentId=17523">this page on the Firefox support forum</a>. None of the suggestions really worked for me but here's what did:<br />
<br />
<ol><li>I started Firefox in safe mode</li>
<li>In the dialog that came up, I chose to disable all add-ons (you could also <span class="inline-code">Continue in Safe Mode</span> to first check if Firefox <em>does</em> start up and then disable add-ons from there)</li>
<li>I started Firefox in 'normal mode' and it worked.</li>
<li>I then re-enabled each plugin, one by one, to determine exactly which one was causing the problem.</li>
<li>In my case it turned out to be the QuickTest Professional 9.5 Plugin. These other plugins didn't seem to bother VS 2005:<br />
<ul><li>DOM Inspector</li>
<li>Firebug</li>
<li>Free Download Mananger plugin</li>
<li>Google Toolbar for Firefox</li>
<li>IE Tab</li>
<li>Java Quick Starter</li>
<li>Live HTTP Headers</li>
<li>Modify Headers</li>
</ul></li>
</ol><br />
<br />
The other suggestions in the forum said to disable the JIT debugger (doesn't really help, all it does is bring up a dialog saying that no debugger was found!), make a new profile/ reinstall ( I suspect that if this works, it's probably because all the plugins are removed ) and for a couple of people, the problem was with AVG Safe Search/ Search Shield.<br />
<br />
So YMMV but this is what worked for me.</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com6tag:blogger.com,1999:blog-2091151685457159297.post-54605560010935546712008-07-31T12:46:00.010-04:002010-05-22T22:12:28.105-04:00Running Two Tomcat Service Instances On The Same Machine<div style="text-align: justify;">I saw this question on a forum recently and though the requirement may not be very common, it was certainly an interesting idea. At first I thought it wasn't possible but after little tampering with the registry, it turned out to be quite easy to achieve.</div><br />
<div class="nogoodwarningbox"><span class="nogoodicon"> </span>Editing the registry is risky! If you're unsure or can't live with the consequences, don't do it. And remember, ALWAYS BACKUP!</div><br />
<div style="text-align: justify;">The instructions below are for Tomcat 6.0 which is installed as service on a Windows [XP] machine.</div><br />
<div style="text-align: justify;">To begin with, these are the keys that are created by the Tomcat installer in the registry; you'll need to modify them. I'll refer to them by their numbers in the steps.</div><br />
<div><a id="regkeyI" name="regkeyI"></a>I. <span class="inline-code">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet \Services\Tomcat6</span><br />
<a id="regkeyII" name="regkeyII"></a>II. <span class="inline-code">HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Procrun 2.0\Tomcat6</span><br />
<a id="regkeyIII" name="regkeyIII"></a>III. <span class="inline-code">HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Tomcat\6.0</span><br />
<a id="regkeyIV" name="regkeyIV"></a>IV. <span class="inline-code">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows \CurrentVersion\Run</span><br />
<a id="regkeyV" name="regkeyV"></a>V. <span class="inline-code">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows \CurrentVersion\Uninstall\Apache Tomcat 6.0</span><br />
<a id="regkeyVI" name="regkeyVI"></a>VI. <span class="inline-code">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum \Root\LEGACY_TOMCAT6</span></div><br />
<div style="text-align: justify;"><ol><li>Install your first instance of Tomcat to, say, <span class="inline-code">C:\Tomcat6_1</span></li>
<li><span class="inline-code">Start > Run > regedit > [ENTER]</span> will bring up the registry editor</li>
<li>Navigate to <span class="inline-code"><a href="#regkeyI">key I</a></span> and rename it from <span class="inline-code">[...]Tomcat6</span> to, say, <span class="inline-code">[...]Tomcat6_1</span>. This will ensure the next install will not overwrite this key<br />
</li>
<li>You should see the values for this key in the right pane; modify <span class="inline-code">DisplayName</span> from <span class="inline-code">Apache Tomcat</span> to, say, <span class="inline-code">Apache Tomcat 1</span>. This is so that you know which service is which later, in the Services console (<span class="inline-code">Start > Run > services.msc > [ENTER]</span>)<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI9F0qwpJo7LEFAICZM13VpdGX8HLVZOZUCR_GzQK8Sga_uyW5wnmLX74TChUmKNwr-rzBg8Qb3RAajEDsw2ezO-Hi7hsC4o5mVFUJsabQP4rr3vxR7XUEfzDycv-qmvuxi6H2ocYyaDxe/s1600-h/services.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI9F0qwpJo7LEFAICZM13VpdGX8HLVZOZUCR_GzQK8Sga_uyW5wnmLX74TChUmKNwr-rzBg8Qb3RAajEDsw2ezO-Hi7hsC4o5mVFUJsabQP4rr3vxR7XUEfzDycv-qmvuxi6H2ocYyaDxe/s320/services.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5229165388857267170" title="services-console"/></a></li>
<li>Modify the <span class="inline-code">ImagePath</span> value from <span class="inline-code">[...]//RS//Tomcat6</span> to <span class="inline-code">[...]//RS//Tomcat6_1</span>. This is the name of the service instance that will be started; we'll need this name later so keep it in mind</li>
<li>The <span class="inline-code">Enum</span> key under <span class="inline-code"><a href="#regkeyI">key I</a></span> has a value <span class="inline-code">0</span> which points to <span class="inline-code"><a href="#regkeyVI">key VI</a></span>. Change the data to reflect the change in the key name that you'll be making later i.e. modify <span class="inline-code">Root\LEGACY_TOMCAT6\0000</span> to <span class="inline-code">Root\LEGACY_TOMCAT6_1\0000</span></li>
<li>Navigate to <span class="inline-code"><a href="#regkeyII">key II</a></span> and rename it also; from <span class="inline-code">[...]Tomcat6</span> to <span class="inline-code">[...]Tomcat6_1</span>. Again, this is to avoid overwriting when installing the second service</li>
<li>Similarly, modify <span class="inline-code"><a href="#regkeyIII">key III</a></span> from <span class="inline-code">[...]6.0</span> to <span class="inline-code">[...]6.0_1</span>. Same reason as above</li>
<li><a href="http://nogoodatcoding.googlepages.com/two-monitor-apps.gif"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://nogoodatcoding.googlepages.com/two-monitor-apps.gif" border="0" alt=""id="" title="two-monitor-apps"/></a>Navigate to <span class="inline-code"><a href="#regkeyIV">key IV</a></span> and modify the value (not the value's data) from <span class="inline-code">ApacheTomcatMonitor</span> to <span class="inline-code">ApacheTomcatMonitor_1</span>. This key is for the monitor application; modifying the key will avoid overwriting of the key on the second install and you'll be able to run two instances of the monitor, one for each service<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4XWHEUstySK_irwuW3kbvsEEQ8LdL-XlKW6UUt0R2oPTq4UbFZhdaLabfTm6rsJcjk-zi0qti-hoaYvPhKQrzR3VjBN2C3xQhdH3T4hKlQ44u4OQysnJCrGWWZ3xWW4JNyBeyAaxGxcgy/s1600-h/modified-monitor-properties.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4XWHEUstySK_irwuW3kbvsEEQ8LdL-XlKW6UUt0R2oPTq4UbFZhdaLabfTm6rsJcjk-zi0qti-hoaYvPhKQrzR3VjBN2C3xQhdH3T4hKlQ44u4OQysnJCrGWWZ3xWW4JNyBeyAaxGxcgy/s320/modified-monitor-properties.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5229165384736003282" title="modified-monitor-properties"/></a></li>
<li><em>Now</em> you modify the data of this value; <span class="inline-code">[...]//MS//Tomcat6</span> to <span class="inline-code">[..]//MS//Tomcat6_1</span>. This is the name of the service that you modified above, for the <span class="inline-code">ImagePath</span> value</li>
<li>If you want to be able to uninstall both the instances of Tomcat later (recommended!), you need to modify <span class="inline-code"><a href="#regkeyV">key V</a></span> and rename it from <span class="inline-code">[...]Apache Tomcat 6.0</span> to <span class="inline-code">[...]Apache Tomcat 6.0_1</span>. Again, to avoid overwriting of the uninstall information</li>
<li>I'm not very sure about <span class="inline-code"><a href="#regkeyIV">key VI</a></span> but I suggest you modify it also. Rename it from <span class="inline-code">[..]LEGACY_TOMCAT6</span> to <span class="inline-code">[..]LEGACY_TOMCAT6_1</span></li>
<li>Restart your system now for the changes to take place</li>
<li>Once you're sure the current install is working as expected, you can install the second instance of your Tomcat. I installed to <span class="inline-code">C:\Tomcat6_2</span></li>
<li>Before you start the second service, you need to change the ports since otherwise it's going to start with exactly the same ones as your first service and throw exceptions and quit. (You could've changed the HTTP listen port while installing) You need to change the <span class="inline-code">HTTP</span> and <span class="inline-code">SHUTDOWN</span> listen ports at least. If either of these is the same or bound to some other process, Tomcat will not start.<br />
<ol><li>Go to <span class="inline-code">$CATALINA_HOME\conf\server.xml</span> (<span class="inline-code">$CATALINA_HOME</span> refers to the Tomcat install directory)</li>
<li>Modify the value for <span class="inline-code"><Server port="8005" shutdown="SHUTDOWN"></span> appropriately</li>
<li>Ditto for <span class="inline-code"><Connector port="8080" protocol="HTTP/1.1"</span></li>
</ol><br />
</li>
<li>Restart the system and the two instances of the monitor as well as the services should start up with no issues</li>
</ol><br />
<br />
You can, of course, extend this to any number of services.<br />
</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com4tag:blogger.com,1999:blog-2091151685457159297.post-71116040035397577522008-07-16T12:44:00.008-04:002010-05-22T21:59:40.351-04:00Making A 2/3-Pin Socket Power Cord For A CN13/CN14 (Standard PC) Power Point<h3 class="post-title">OR Putting An Old UPS To Use</h3><br />
<br />
<div style="text-align: justify;">The power situation in India is pretty bad; I've had days when the power would go keep coming and going out every 10-15 minutes. Needless to say, the effect on my Internet experience is pretty dampening.<br />
<br />
A friend of mine recently lent me an old APC UPS. We figured it'd be enough to power my network switch and my DSL modem, keeping my connection alive.</div><br />
<div style="text-align: justify;">Unfortunately, the UPS only had output in the form of <span class="inline-code"><a href="http://en.wikipedia.org/wiki/IEC_connector#C13_and_C14_connectors">IEC C13 sockets</a></span> (female).</div><br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicx7B2-3s7pF2vWHzP7LCyqPQHruUeGEqXt5tCYB6jz5SOImmFwIjOYy95as3RuOPCBXiwZvmLqaIHFNfSOu1cy5LSg1910pfVPY4TUt6_ceWl2dy28u77lnKtVpgAMCrJzZCvtj4MwiBd/s1600-h/UPS_Rear_Panel.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicx7B2-3s7pF2vWHzP7LCyqPQHruUeGEqXt5tCYB6jz5SOImmFwIjOYy95as3RuOPCBXiwZvmLqaIHFNfSOu1cy5LSg1910pfVPY4TUt6_ceWl2dy28u77lnKtVpgAMCrJzZCvtj4MwiBd/s320/UPS_Rear_Panel.png" alt="" id="BLOGGER_PHOTO_ID_5223529381976680274" title="rear-panel-of-the-ups-with-cn13-sockets" border="0" /></a><br />
<div style="text-align: justify;">This wasn't going to work for me because I needed to connect common <span class="inline-code"><a href="http://en.wikipedia.org/wiki/Domestic_AC_power_plugs_and_sockets#Type_C_.28European_2-pin.29">C</a></span>, <span class="inline-code"><a href="http://en.wikipedia.org/wiki/Domestic_AC_power_plugs_and_sockets#Type_D_.28Old_British_3-pin.29">D</a></span> or <span class="inline-code"><a href="http://en.wikipedia.org/wiki/Domestic_AC_power_plugs_and_sockets#Type_M_.28see_D.29">M</a></span> type 2/3-pin plugs. I asked at a few shops but there doesn't seem to be any connector or convertor for this purpose. So I decided to hack together something to use.</div><br />
<div style="text-align: justify;">I bought a <span class="inline-code">CN14-CN13</span> cable and a box type 3-pin socket.</div><br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMdWGK1g9XS349JsQpNysP2cABwF6T_CW4gEdvmoOHRmPq1FAg9XjRMRemFL9hZ19xhZq4ZpVIa_i4tcnZcuyXCSIsHz_Lj-L3kVUkok1_yUEp319r9TIhOr7n4fLdpo2kdO5_DqAutqt8/s1600-h/Cable.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMdWGK1g9XS349JsQpNysP2cABwF6T_CW4gEdvmoOHRmPq1FAg9XjRMRemFL9hZ19xhZq4ZpVIa_i4tcnZcuyXCSIsHz_Lj-L3kVUkok1_yUEp319r9TIhOr7n4fLdpo2kdO5_DqAutqt8/s320/Cable.png" alt="" id="BLOGGER_PHOTO_ID_5223529422984566866" title="cn13-cn14-cable" border="0" /></a><br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-AjkFyIboQUyaaorFGWsayLtVs94EJajNj91Jw3tx_eovVqwz94fIa2nADAfsJVBs-ToAXogb3HawcSe_4pNUlkJNDEAwa7BQD5iDQHZn9gNrMTQXhTslawhKA7DcYrCAtx4cXQ2FLHra/s1600-h/Plug_wiring.png"><img style="float:right; margin: 0px auto 10px; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-AjkFyIboQUyaaorFGWsayLtVs94EJajNj91Jw3tx_eovVqwz94fIa2nADAfsJVBs-ToAXogb3HawcSe_4pNUlkJNDEAwa7BQD5iDQHZn9gNrMTQXhTslawhKA7DcYrCAtx4cXQ2FLHra/s320/Plug_wiring.png" alt="" id="BLOGGER_PHOTO_ID_5223529455333050242" title="wiring-the-socket" border="0" /></a><br />
<div style="text-align: justify;">I sliced off the <span class="inline-code">CN13</span> (female) connector on the cable and separated the wires in the remaining part. I then wired them to the plug-point and, well, that was it! I now have this:</div><br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgkhCM6Tnqr3cW2Ud5gw2cmhfTPH9h1U5eTW5qBgBkEPd8gYsmx1938Sh3WrUhX-hC3n2BzfGlo5ToTkB3tkFUwXZylhaAWlCD-JAfusA6aYB-ShDA0Cn9G_puJalMpXQ-_1p9RApcD0-k/s1600-h/Connector_finished.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgkhCM6Tnqr3cW2Ud5gw2cmhfTPH9h1U5eTW5qBgBkEPd8gYsmx1938Sh3WrUhX-hC3n2BzfGlo5ToTkB3tkFUwXZylhaAWlCD-JAfusA6aYB-ShDA0Cn9G_puJalMpXQ-_1p9RApcD0-k/s320/Connector_finished.png" alt="" id="BLOGGER_PHOTO_ID_5223529466526958082" title="the-finished-connector" border="0" /></a><br />
<div style="text-align: justify;">I simply plug it into the back of the UPS and I have backup power! Very easy, very obvious but it still pretty satisfying and very useful :D</div><br />
<div class="nogoodwarningbox"><span class="nogoodicon"> </span>Be careful with the wiring! If you've never done it before, you should consider getting someone who has to assist you. I had a bit of trouble when some loose wires I'd left in the box short-circuited and blew the connection apart!</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com1tag:blogger.com,1999:blog-2091151685457159297.post-74596141487108256542008-07-01T09:59:00.005-04:002008-07-01T10:48:44.397-04:00Google Toolbar Flags orkut.co.in As A Web Forgery<div style="text-align: justify;">A funny thing happened today; I was checking out my communities on <a href="http://orkut.com/">orkut</a> when this popped up in Firefox -</div><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEK4S2s2s_lTZIhAn7yXwFJCTG0xa3W4Ap64ejj_IQAakCNb82DEvj943x13haMvspYcPwoorIktq2-4W63uDHovoRK1FAIDt0QlYNwe8ZM4bERCBrkV28IJ50tjgDzkw0VB_-QkYh49l-/s1600-h/orkut-web-forgery.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTUgb4FdnD0t55uFRikxuMDmJdrrLrPck7Q-aPUKu3znMvs88MtdEMG91aOVUXeK96sJcg_Nb3pcAz069Wv5RzYZU8gb-HwGtxdo7nGHf4zUAnDa16JcyOlbhFMMEcqCf_wCkNinaskfyR/s320/orkut-web-forgery-cropped.png" border="0" alt="orkut-web-forgery" title="Click to see the full-screen capture" id="BLOGGER_PHOTO_ID_5218048077654050114" /></a><br /><div style="text-align: justify;">This is the first time that I've seen this. I believe it's a Google Toolbar feature, but I'm not quite sure. The odd thing is that the warning only appeared when I tried to go to the communities pages while on the orkut.co.in domain and not on orkut.com.<br /><br />I followed the <strong><em>This isn't a web forgery</em></strong> link ( which took me to a Google page, hence my assumption this is a Google Toolbar feature ) and reported the error. But it's ironic that Google's feature would block one of Google's own websites!</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com2tag:blogger.com,1999:blog-2091151685457159297.post-67052359064399239732008-06-04T12:30:00.020-04:002010-05-22T21:09:27.745-04:00Hacking The Cisco 7940 IP Phone<h3 class="post-title">Or How To Change The Ringtone And Idle Logo On The Cisco 7940G IP Phone</h3><br />
<h4>Quick-Links</h4><ol><li><a href="#hackciscophone-prereqs">Pre-requisites</a></li>
<li><a href="#hackciscophone-setuptftpserver">Setup a TFTP server</a></li>
<li><a href="#hackciscophone-configurephone">Configure the phone to use your TFTP server</a></li>
<li><a href="#hackciscophone-getconfiguration">Get the phone configuration data</a></li>
<li><a href="#hackciscophone-modifyconfiguration">Modify the configuration files</a></li>
<li><a href="#hackciscophone-createlogo">Create a new logo</a></li>
<li><a href="#hackciscophone-createringtone">Create a new ringtone</a></li>
<li><a href="#hackciscophone-updatephone">Update the phone</a></li>
<li><a href="#hackciscophone-troubleshooting">Notes and troubleshooting</a></li>
<li><a href="#hackciscophone-samples">Samples</a></li>
<li><a href="#hackciscophone-resources">Resources</a></li>
</ol><div class="nogoodwarningbox"><span class="nogoodicon"> </span> I want to point out right at the start that this is what I've put together after gleaning information from <a href="#hackciscophone-resources">various sources on the Internet</a>. I don't really know what I'm doing!</div><br />
<div style="text-align: justify;">I was sitting around doing nothing at work yesterday and I started fiddling with my desk phone, a <a href="http://www.cisco.com/en/US/products/hw/phones/ps379/ps1854/index.html">Cisco 7940 IP Phone</a>. I changed the ringtone and reached the <span class="inline-code">Network Configuration</span> menu. I noticed the phone's IP and just for the heck of it, tried to open it up in the browser. Surprise! It shows a lot of the details of the phone and its network settings.<br />
<br />
I then realized that there was more to the device than it would appear and I Google'd around for some hacks. The first few things I came across were that it was possible to load your own ringtones and change the idle logo.</div><br />
<div class="nogoodwarningbox"><span class="nogoodicon"> </span> Before you make any changes, make sure you note down the original value/ setting! You don't want to be calling your Help-Desk and explaining to them what you were doing!<br />
<br />
You can save almost all the relevant information by going to <span class="inline-code">http://[your-phone-ip-address]</span> in your browser and choosing the <span class="inline-code">Network Configuration</span> link. You should see a page that looks like:<br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipzdmqAvIEXe0__uz0k3ks2tCTk7rINIizFcGsqa1XE_FpH94XzGD6DQ6axx-Vn5f_mAeovEEL31tMDYSG1F3CJcI_9SO0QCZZJCI2IgEyanmxLpexkFkQRWWPfOat0Nf97ZD6EA8o7bO7/s1600-h/IP+Phone+Configuration+In+Browser.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipzdmqAvIEXe0__uz0k3ks2tCTk7rINIizFcGsqa1XE_FpH94XzGD6DQ6axx-Vn5f_mAeovEEL31tMDYSG1F3CJcI_9SO0QCZZJCI2IgEyanmxLpexkFkQRWWPfOat0Nf97ZD6EA8o7bO7/s320/IP+Phone+Configuration+In+Browser.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5208058967256275826" /></a><br />
You can save/ print this page for future reference and roll-backs. To get your phones IP address, check under <span class="inline-code">Settings > Network Configuration</span> on the phone.<br />
</div><br />
<a id="hackciscophone-prereqs" name="hackciscophone-prereqs"></a><h4>Pre-requisites</h4><div style="text-align: justify;">You're going to need the following things for this:<br />
<ol><li>A Cisco IP Phone - I've got the 7940 model but from what I can tell, these steps should work on other similar ones also.</li>
<li>A <a href="http://en.wikipedia.org/wiki/Trivial_File_Transfer_Protocol">TFTP</a> server - I used the <a href="http://www.solarwinds.com/register/MoreSoftware.aspx?Program=52">free TFTP server from SolarWinds</a></li>
<li>A web server - This applies only if you want to change the logo.</li>
<li>A utility to convert images to CIP - Again, this applies only if you want to change the logo. And if you don't want to be coding the required files by hand! <div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span> Cisco provides an SDK that includes these but you need to register on the site ( and you might need to enter contract details, which might not be possible if the phone is at your workplace ). I wasn't able to complete the registration, kept getting session timeout errors so, I'm not sure how/ if this works.</div><span class="footer"> </span></div><br />
<br />
I used the free utilities by Mark Palmer that can be downloaded from <a href="http://search.cpan.org/~mrpalmer/Cisco-IPPhone-0.05">http://search.cpan.org/~mrpalmer/Cisco-IPPhone-0.05</a></li>
<li>An image editor that supports GIFs and resizing - Again, you'll only need this to create logos. I used Adobe Photoshop but any decent editor should server you well.</li>
<li>An audio editor that supports creation of RAW audio files - This only applies if you want to be able to create ringtones. I used the trial version of <a href="http://www.goldwave.com">GoldWave</a>; it’ll let you perform 150 commands in a session and up to 2000 commands after which the trial version will expire.</li>
</ol></div><br />
<a id="hackciscophone-setuptftpserver" name="hackciscophone-setuptftpserver"></a><h4>Setup a TFTP server</h4><div class="nogoodwarningbox"><span class="nogoodicon"> </span> TFTP is NOT the same as FTP! The servers/clients are not interchangeable!<br />
<br />
Your OS probably has a built-in TFTP client ( try typing <span class="inline-code">tftp</span> at the console ) but you'll need a server.</div><br />
<div style="text-align: justify;">The phone uses TFTP to pick up its configuration files when it boots. Usually this is some server that the IT department in your company maintains but you can easily modify the phone's settings to use your private TFTP server instead.<br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimdWdGAo6y8xsD0KYiT6k0Ldfk4T32ciGMQ8xOIYWze4NOB456wMRcqkQsas5zmLFbG5vE8HXQb26Fnpc-Fkx1WFUA1gJ9sRJeOctatjLqjDLZTxpU4hMkdZCMdRUAdISp5GD8-K8gNKpZ/s1600-h/TFTP+Server+Configuration.png"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimdWdGAo6y8xsD0KYiT6k0Ldfk4T32ciGMQ8xOIYWze4NOB456wMRcqkQsas5zmLFbG5vE8HXQb26Fnpc-Fkx1WFUA1gJ9sRJeOctatjLqjDLZTxpU4hMkdZCMdRUAdISp5GD8-K8gNKpZ/s320/TFTP+Server+Configuration.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5208059362666245266" /></a><br />
The SolarWinds TFTP server is really simple to use. Simply install and run the application. Choose <span class="inline-code">File > Configure</span>. Modify the options as you see fit. Do note down the TFTP Server Root Directory ( <span class="inline-code">C:\TFTP-Root</span> by default ). Don't forget to start the service!</div><br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span> The SolarWinds TFTP server automatically logs all the requests it gets. If you're using some other server, see if you can/ need to increase the logging level, at least initially, to get a list of files required.</div><span class="footer"> </span></div><br />
<div style="text-align: justify;">That's it; your TFTP server is now running. You can check it with the command line TFTP client that Windows XP and Mac OS X have ( I don't know about Linux but I'm sure it must! ). Go to the command line and type in <span class="inline-code">tftp</span>. On Windows XP, you'll get the following:</div><br />
<pre class="brush: plain">C:\>tftp
Transfers files to and from a remote computer running the TFTP service.
TFTP [-i] host [GET | PUT] source [destination]
-i Specifies binary image transfer mode (also called
octet). In binary image mode the file is moved
literally, byte by byte. Use this mode when
transferring binary files.
host Specifies the local or remote host.
GET Transfers the file destination on the remote host to
the file source on the local host.
PUT Transfers the file source on the local host to
the file destination on the remote host.
source Specifies the file to transfer.
destination Specifies where to transfer the file.
C:\>
</pre><br />
<div style="text-align: justify;">On the Mac, you'll simply get the TFTP prompt: <span class="inline-code">tftp></span><br />
<br />
The command is not very hard to figure out so I'll leave out part explaining how to use it.</div><br />
<a id="hackciscophone-configurephone" name="hackciscophone-configurephone"></a><h4>Configure the phone to use your TFTP server</h4><div style="text-align: justify;">Now that you have a TFTP server running you need to point the phone to it. Do the following:<br />
<ol><li>On the phone, go to the settings menu and select <span class="inline-code">Network Configuration</span>. The options are not editable by default so you need to key in the secret password, <span class="inline-code">**#</span>. You should see the tiny lock icon at the top unlock.<br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRuBYrsruNShFvWQpnoZ1K20R76HKGW24pq0lqeGb-rpnGbHo-HX6U5xdycHUrR4VEvmseYQgoshsNr-eBe1mrgPpdsDL_tcP-T4Tzgj4lDk6JsFmZAvl7ge0d9VqN2kIoBvw5We1saoQx/s1600-h/Unlock+Phone+Configuration.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRuBYrsruNShFvWQpnoZ1K20R76HKGW24pq0lqeGb-rpnGbHo-HX6U5xdycHUrR4VEvmseYQgoshsNr-eBe1mrgPpdsDL_tcP-T4Tzgj4lDk6JsFmZAvl7ge0d9VqN2kIoBvw5We1saoQx/s320/Unlock+Phone+Configuration.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5208059729320750066" /></a></li>
<li>A long way down in the list of options ( option #32 on my phone ), you'll find the option for <span class="inline-code">Alternate TFTP</span>. You need to set this to <span class="inline-code">YES</span> so that you can change the actual TFTP server address.</li>
<li>Go back up to the top of the list ( irritating? Yes, I know! But you can key in the option number to speed things up. ) to reach the option for <span class="inline-code">TFTP Server 1</span>. Edit this, type in the IP to your machine and <span class="inline-code">Validate</span>.</div><br />
<div class="nogoodwarningbox"><span class="nogoodicon"> </span> Note down the original TFTP server IP address before you modify it!</div></li>
<li>Once you choose to <span class="inline-code">Save</span>, the phone will reboot. It will now try to get the configuration files from your TFTP server. In the TFTP server logs, you should see the requests for various files, collate the file names into a handy list.</li>
</ol><br />
<a id="hackciscophone-getconfiguration" name="hackciscophone-getconfiguration"></a><h4>Get the phone configuration data</h4><div style="text-align: justify;">As noted above, your TFTP server should be logging all the requests from the phone. This will give you a list of configuration and resource files required by the phone.<br />
<br />
You should now use the original TFTP server ( you <em>did</em> note down the IP address didn't you? ) to get all these files ( use the command line TFTP client built-in to your OS ). Then copy them into your TFTP server root so that your phone can pick them up from there instead. Simple, huh?</div><br />
<a id="hackciscophone-modifyconfiguration" name="hackciscophone-modifyconfiguration"></a><h4>Modify the configuration files</h4><div style="text-align: justify;">You'll find some XML files in the collateral that you download from the original TFTP server. One of these would be named something like <span class="inline-code">SEP0123456789AB.cnf.xml</span>. This name comes from the host name of your phone ( <span class="inline-code">SEP0123456789AB</span> in this case ) which itself is derived from the MAC address of the phone ( <span class="inline-code">01-23-45-67-89-AB</span> ). This is the main configuration file.<br />
<br />
Open it in any text editor and look for the tag <span class="inline-code"><idleURL></span>. This points to the place where the 'screensaver' graphics are picked up.<br />
<br />
The graphics displayed on the phone are not your usual image files but instead a special XML. You can see how to create the required XML file <a href="#hackciscophone-createlogo">below</a>. For now, you need to know that you will need to host this XML on a web server on your machine so that the phone can pick it up from there. You can also leave it as it is, the phone will then continue to use the original logo that it had.</div><br />
<div class="nogoodwarningbox"><span class="nogoodicon"> </span> Make sure that your web server uses the mime-type <span class="inline-code">text/xml</span> when serving XML!<br />
<br />
I spent almost half an hour trying to debug why an XML hosted on Tomcat was not being used for the logo when I could see the phone hitting the correct URL and getting the correct response from the server.<br />
<br />
It hit me later that it was probably a mime-type mismatch and I then tried IIS. Voila! That worked! I then checked the responses of each server using the <a href="https://addons.mozilla.org/en-US/firefox/addon/3829">Live HTTP Headers plugin for Firefox</a> and saw the difference in content-type.</div><br />
<a id="hackciscophone-createlogo" name="hackciscophone-createlogo"></a><h4>Create a new logo</h4><div class="nogoodtipbox"><span class="nogoodicon"> </span> I'd suggest downloading the original XML that the <span class="inline-code"><idleURL></span> tag was pointing to and putting that on your web server at first. This will help rule out malformed or unsupported images while troubleshooting. Once you get everything setup, you can replace this with your custom file.</div><br />
<div style="text-align: justify;">The logo is usually in the CIP ( Cisco IP Phone Image document ) format which is an XML file with some specific tags and the image data in hex. You can use the <span class="inline-code">gif2cip</span> application to convert a GIF image into the required XML. The Cisco 7940 IP Phone uses images that are a max of 133 pixels wide by 65 pixels tall. You can find out more about your particular phone model by checking out the Cisco site for appropriate documentation.<br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5BxKbrCfY5MT4wb8VUUBkPI7_TnpDWmQzo-dMR4gqtazyeFDJ34BKoe6FuTfCOc8Ox4vHtFcHnQRFrejIBm5WxTgjmjGRPRcV3cXi7a2DZA1bdEyZafNcmp2s9sfoEPMz6CYjbFeGa9dI/s1600-h/CIP+To+Phone.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5BxKbrCfY5MT4wb8VUUBkPI7_TnpDWmQzo-dMR4gqtazyeFDJ34BKoe6FuTfCOc8Ox4vHtFcHnQRFrejIBm5WxTgjmjGRPRcV3cXi7a2DZA1bdEyZafNcmp2s9sfoEPMz6CYjbFeGa9dI/s320/CIP+To+Phone.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5208060529217289314" /></a><br />
The logos seem to come out better if they have minimum gradients, sharp boundaries and fewer colours. You might have to give this quite a few tries to get acceptable results.<br />
<br />
Get an image you like, use an image editor to resize it within the supported boundary limits and then save it as a GIF. Use the gif2cip application to convert this to a CIP document. If you have Photoshop, you can also use the plugin to save it directly as a .CIP file. If you open the document in a text editor, you'll see the XML tag for <span class="inline-code"><Prompt></span>. This is the text that is displayed on the phone when the screensaver is on. Modify it as you see fit.<br />
<br />
You can now put up this XML on your web server, ready to be requested by the phone.</div><br />
<div class="nogoodtipbox"><span class="nogoodicon"> </span> The phone requests the logo XML <span class="inline-code">every time</span> the screensaver comes on! This means you could serve this images dynamically to some purpose like random images or whatever else you can think of.</div><br />
<a id="hackciscophone-cisco-createringtone" name="hackciscophone-createringtone"></a><h4>Create a new ringtone</h4><div style="text-align: justify;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOVae6bNUU_D2MV0y0fP2fJ18_stD7EbrEAnHiUkMfV8iiqeTYgEB7HfZqpZ-7zrWIlnTjNbuWwmD4430f0l3IBWtTgvQubUZxoVCUfw9uYT9Pfu9fXxhyphenhyphen6eeu0Jnke3kzJZ5cQne7j70Q/s1600-h/GoldWave+Save+Settings.png"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOVae6bNUU_D2MV0y0fP2fJ18_stD7EbrEAnHiUkMfV8iiqeTYgEB7HfZqpZ-7zrWIlnTjNbuWwmD4430f0l3IBWtTgvQubUZxoVCUfw9uYT9Pfu9fXxhyphenhyphen6eeu0Jnke3kzJZ5cQne7j70Q/s320/GoldWave+Save+Settings.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5208060848780706594" /></a><br />
The ringtones supported by the phone must <a href="http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/admin/3_0_9/a3rings.html#wp1005223">conform to certain strict requirements</a>. I'm not very clear on these.<br />
<br />
All I did was use GoldWave to snip out parts of an MP3 and save as a <span class="inline-code">Raw (*.snd)</span> file with the attributes you can see in the image. These worked for me but the length of the tone is pretty short. I'll try out some more options to see if it can be longer but I doubt it.<br />
<br />
The ringtones are listed in a file named <span class="inline-code">RINGLIST.XML</span> ( you should have got this from the original TFTP server and it should be available in your TFTP server root directory ). It has entries of the form</div><br />
<pre class="brush: xml"><Ring>
<DisplayName>Are You There 1</DisplayName>
<FileName>AreYouThere.raw</FileName>
</Ring>
</pre><br />
<div style="text-align: justify;">You'll need to add your new ringtone in similar elements. The display name is what the phone shows in its UI. The filename is the name of the ringtone you created ( change the extension to <span class="inline-code">raw</span> if it isn't already ).Save the changes you've made to the file.</div><br />
<div class="nogoodtipbox"><span class="nogoodicon"> </span> If you want to be able to use the ring tones that were available on your phone by default, you will need to get those from the TFTP server as well. The <span class="inline-code">RINGLIST.XML</span> entries will tell you the names of the ringtones and you should put them in your TFTP server root directory along with the rest of the files.</div><br />
<a id="hackciscophone-updatephone" name="hackciscophone-updatephone"></a><h4>Update the phone</h4><div style="text-align: justify;">Now that you've got all your stuff ready and made all necessary configuration changes, you're ready to try it out!<br />
<br />
The phone picks up configuration files only when it's booting. So you can either unplug then replug it or use <span class="inline-code">**#**</span> while in the Network Configuration menu.<br />
<br />
You should see your TFTP server logging requests for various files, just like before. Only this time, it actually has those files and can serve them up to the phone! Once it's done booting, you should see the logo come up after the default idle timeout ( you can change this too; check the <span class="inline-code">SEP0123456789AB.cnf.xml</span> we modified earlier for <span class="inline-code"><idleTimeout></span> ).<br />
<br />
If you followed my suggestion earlier and used your original XML, you should now replace it with your custom file and refresh the screensaver ( you don't need to restart the phone, you can either select <span class="inline-code">Update</span> or just perform some action, like picking up the handset and putting it back; that interrupts the screensaver and then starts it again ). If everything has been setup correctly, you should see the image you want!<br />
<br />
Your ringtone should be listed under <span class="inline-code">Settings > Ring Type > Default Ring</span>. When you choose to <span class="inline-code">Play</span> the file, you should see a request on your TFTP server, for the corresponding <span class="inline-code">.raw</span> audio file. If it's too big or not in the correct format, you'll see errors. If it's acceptable, you'll hear your ringtone play.</div><br />
<a id="hackciscophone-troubleshooting" name="hackciscophone-troubleshooting"></a><h4>Notes and troubleshooting</h4><div style="text-align: justify;">Like I mentioned earlier, I got this to work on the Cisco 7940 IP Phone specifically, using instructions and information from various sources. So I'm not sure how this applies to other models. However, the following checklist should help you locate the problem:</div><br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span> Verify that your TFTP server is working properly by trying to fetch a file using a client other than the phone.</div><span class="footer"> </span></div><br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span> Verify that the changes you made to the TFTP server IP address on your phone have indeed been saved.</div><span class="footer"> </span></div><br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span> Verify that your server is not logging any failed file transfers. If it is, you may have forgotten to get some files from the original TFTP server or you mustn't have placed them in the current TFTP server's root directory.</div><span class="footer"> </span></div><br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span> Verify that you've modified the <span class="inline-code"><idleURL></span> tag to point to the correct location of the logo.</div><span class="footer"> </span></div><br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span> Verify that the changed URL for the logo is seen in the settings on the phone, to make sure it's picking up the correct configuration.</div><span class="footer"> </span></div><br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span> Verify that you can fetch the required logo XML from your web server by using a browser to hit the URL. Also verify the content-type being returned by the server; my phone required it to be <span class="inline-code">text/xml</span>.</div><span class="footer"> </span></div><br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span> Once you try to load your ringtone, you should see a request for the *.raw audio file getting logged by the TFTP server. Verify that it's the correct filename.</div><span class="footer"> </span></div><br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span> If the phone displays an error, try to make the ringtone again. The requirements are pretty strict and you may need to snip quite a bit of the audio to be able to load the file onto the phone.</div><span class="footer"> </span></div><br />
<a id="hackciscophone-samples" name="hackciscophone-samples"></a><h4>Samples</h4><div style="text-align: justify;">You can try out some of these sample logos and ringtones that I'd made; they're working for me and could be a starting point for you in case you don't have immediate access to the required tools. Save the files and host them on your server.</div><br />
<div class="nogooderrorbox"><span class="nogoodicon"> </span> Linking directly to these graphics files will probably not work:<br />
<ul><li>I'm not sure if the phone would pick up something off of the Internet</li>
<li>Your admin would have proabably restricted access to the Internet from the phone</li>
<li>The mime-type these servers respond with may not be what the phone expects</li>
</ul></div><br />
<div style="text-align: justify;">Graphics:<br />
<a href="http://nogoodatcoding.googlepages.com/batman.xml">The Batman Logo</a><br />
<a href="http://nogoodatcoding.googlepages.com/unreal.xml">The Unreal Logo</a><br />
<br />
Ringtones:<br />
<a href="http://nogoodatcoding.googlepages.com/MI2.raw">The opening notes of the M:I-2 theme</a><br />
<a href="http://nogoodatcoding.googlepages.com/Moby-InMyHeart.raw">Moby's <strong><em>In My Heart</em></strong>, from the Nokia ad</a>.<br />
<br />
You can also get the ringtone of the [Cisco IP] phones from the TV show 24 from <a href="http://www.reformed.plus.com/ringtone/">here</a>. In case the page is down, you can get the files it linked to from <a href="http://www.mobileradio.cc/mirror/ringtones/CTU24.raw">here</a>, <a href="http://www.mobileradio.cc/mirror/ringtones/CTU.raw">here</a> and <a href="http://www.mobileradio.cc/mirror/ringtones/CTU_final.raw">here</a>.<br />
<br />
If you create something that you think others might like, please let me know, I'll link to it in the list above.</div><br />
<a id="hackciscophone-resources" name="hackciscophone-resources"></a><h4>Resources</h4><ul><li><a href="http://plutor.org/blog/2005/05/05/143338/">http://plutor.org/blog/2005/05/05/143338/</a></li>
<li><a href="http://blog.johnath.com/index.php/2006/12/05/hacking-the-cisco-79xx-series/">http://blog.johnath.com/index.php/2006/12/05/hacking-the-cisco-79xx-series/</a></li>
<li><a href="http://search.cpan.org/~mrpalmer/">http://search.cpan.org/~mrpalmer/</a></li>
<li><a href="http://www.cisco.com/warp/public/788/AVVID/idle-url.html">http://www.cisco.com/warp/public/788/AVVID/idle-url.html</a></li>
<li><a href="http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/admin/3_0_9/a3rings.html">http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/admin/3_0_9/a3rings.html</a></li>
<li><a href="http://www.ibm.com/developerworks/wireless/library/wi-voip/">http://www.ibm.com/developerworks/wireless/library/wi-voip/</a></li>
</ul>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com27tag:blogger.com,1999:blog-2091151685457159297.post-64747767456489513812008-05-30T13:00:00.002-04:002008-05-30T13:05:58.344-04:00Google Has A New Favicon<div style="text-align: justify;">Google now sports a brand-new <a href="http://en.wikipedia.org/wiki/Favicon">favicon</a> (<a href="http://www.google.com/favicon.ico">http://www.google.com/favicon.ico</a>).<br /></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZpwILOdfNcEEZLoXugZXwKH9bBTSjLRYttMQv5T8w47TltWnkF6OyVoeYKqG4oJREMB6cZ9GaDJCRfjqvkJajrs-Nyucb2UNksx2l6vEpfxvgfKJquykw-46kcz890lzMrPntGxkEAmfP/s1600-h/Google+Favicon+Address+Bar+-+New.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZpwILOdfNcEEZLoXugZXwKH9bBTSjLRYttMQv5T8w47TltWnkF6OyVoeYKqG4oJREMB6cZ9GaDJCRfjqvkJajrs-Nyucb2UNksx2l6vEpfxvgfKJquykw-46kcz890lzMrPntGxkEAmfP/s320/Google+Favicon+Address+Bar+-+New.png" alt="" id="BLOGGER_PHOTO_ID_5206217452701357266" border="0" /></a><br /><div style="text-align: justify;">Just in case you never noticed or were so used to it that you don't remember, this is what the old one looked like:<br /></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1D2LPBVw5gBXvpteYN2ptopjlPy8dDx1IeinHndph6pNavSBL_Vgis_eou-k7W-XW24mz47idH0wOZW5R3OwdlcNH022_szDYaEmGlzYhpv_Yi43kbfzRVAV-k6QCHllEn1DCiPY6KzCd/s1600-h/Google+Favicon+Address+Bar+-+Old.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1D2LPBVw5gBXvpteYN2ptopjlPy8dDx1IeinHndph6pNavSBL_Vgis_eou-k7W-XW24mz47idH0wOZW5R3OwdlcNH022_szDYaEmGlzYhpv_Yi43kbfzRVAV-k6QCHllEn1DCiPY6KzCd/s320/Google+Favicon+Address+Bar+-+Old.png" alt="" id="BLOGGER_PHOTO_ID_5206217456996324578" border="0" /></a><br /><div style="text-align: justify;">Can't say I'm a fan of the new one though; seems too generic somehow.</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com2tag:blogger.com,1999:blog-2091151685457159297.post-20538170987149072782008-05-27T15:18:00.008-04:002010-05-09T06:52:10.265-04:00Cleaning Out ADVIRS.exe, A Relatively Unknown Virus<div style="text-align: justify;">At work today, a friend of mine told me that he was unable to start Command Prompt or Task Manager. Any seasoned PC user will immediately recognize these as the symptoms of a possible virus infection. He then admitted that he'd let his brother use his pen drive to copy some stuff off his laptop over the weekend. Bingo!<br />
<br />
But now what? We had no idea what virus it was and his updated enterprise edition of McAfee Anti-Virus didn't detect anything ( so much for all that money we pay them! ) and we couldn't run Task Manager to see which suspicious process were running.<br />
<br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMPzUPTV2YQnNPI6BPNa_aJF99dcslpjnu5ere-3hPdv5znngplSrGqd2FagTJIS3gBhqrx3hk_UKyP82LotQlvlI5Yqu5FWIk41LCyM2gpgC_pLexjy92REQ7YCa5jXZjmAD7xn7SLuuc/s1600-h/System_Privileges.png"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMPzUPTV2YQnNPI6BPNa_aJF99dcslpjnu5ere-3hPdv5znngplSrGqd2FagTJIS3gBhqrx3hk_UKyP82LotQlvlI5Yqu5FWIk41LCyM2gpgC_pLexjy92REQ7YCa5jXZjmAD7xn7SLuuc/s320/System_Privileges.png" alt="" id="BLOGGER_PHOTO_ID_5205151714409029218" border="0" /></a><br />
Just yesterday, I'd read <a href="http://tech.slashdot.org/article.pl?sid=08/05/26/0257213">this article on Slashdot about gaining system privileges in Vista</a>. The comments noted that this was also possible in Windows 2000/XP et al.<br />
<br />
I had been planning to try it out and here was a great chance to see if it would work.<br />
<br />
Here's the idea: The accessibility utilities, like Magnifier ( <span class="inline-code">C:\WINDOWS\system32\magnify.exe</span> ) and Sticky Keys ( <span class="inline-code">C:\WINDOWS\system32\sethc.exe</span> ) are applications that can be run from the login screen before logging into the computer ( Use <span class="inline-code">Win + U</span> and/or press the <span class="inline-code">Shift</span> key 5 times ). They are started with privileges higher than that of any user, including administrator.</div><br />
<br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span>Starting them after you login will start them with your user account and they'll get those privileges. You <em>must</em> start them from the login screen.</div><span class="footer"> </span></div><br />
<br />
<div style="text-align: justify;">So if you can replace the EXEs with some other application EXE, it would get invoked with those privileges. And what would be the best candidate for such a replacement? Good old Command Prompt ( <span class="inline-code">C:\WINDOWS\system32\cmd.exe</span> ). Once you do this and invoke Magnifier ( or Sticky Keys ), you'd end up starting Command Prompt with system level access. You can now do stuff that even the administrator accounts would not be able to ( I'm yet to discover what these are but the comments on the aforementioned Slashdot article have me convinced that this is indeed the case )<br />
<br />
So, to do this, you should :<br />
<br />
1. Make a copy of <span class="inline-code">cmd.exe</span><br />
2. Rename <span class="inline-code">magnify.exe</span> to <span class="inline-code">magnify.exe.bak</span> ( Always backup! )<br />
3. Rename the copy of <span class="inline-code">cmd.exe</span> to <span class="inline-code">magnify.exe</span><br />
<br />
You'll have to do steps 3 pretty quickly because in about 5 odd seconds, Windows realizes that <span class="inline-code">magnify.exe</span> is missing and replaces it! So you could copy the filename and keep it ready and then quickly paste it. It's up to you. The idea is that rename the copy before the original magically reappears.<br />
<br />
Back to the anecdote. Once I did this, I then started Magnifier and lo behold! Command Prompt opened up! We could now run <span class="inline-code">tasklist</span> to get a list of running processes and their <span class="inline-code">PID</span>s. We were luck, my friend immediately spotted two instances of <span class="inline-code">advirs.exe</span> and when we Google'd it, we knew it was the culprit. We used <span class="inline-code">taskkill</span> to end the two processes and then tried running Task Manager and it worked!</div><br />
<br />
<pre class="brush: plain">Image Name PID Session Name Session# Mem Usage
========================= ====== ================ ======== ============
ADVIRS.exe 3276 Console 0 5,992 K
YahooMessenger.exe 4056 Console 0 15,416 K
JabberMessenger.exe 3560 Console 0 42,748 K
GoogleToolbarNotifier.exe 4028 Console 0 1,060 K
ADVIRS.exe 3652 Console 0 5,980 K
</pre><br />
<br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span>We'd redirected the output of <span class="inline-code">tasklist</span> into a text file but when we opened it to see the <span class="inline-code">PID</span> of <span class="inline-code">ADVIRS.EXE</span>, the dumb virus wouldn't let us search for the string 'advirs'! So we searched for 'advi'. Clever, huh?</div><span class="footer"> </span></div><br />
<br />
<div style="text-align: justify;">I then got my friend to install WinPatrol to protect against future autorun programs. We also used it to remove the registry key for running <span class="inline-code">advirs.exe</span> on startup - <span class="inline-code">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Advirs</span><br />
<br />
<a href="http://www.incodesolutions.com/threats2/Win32Rootadvirsexe.php">RemoteIT was the only antivirus that turned up in the search results for this virus</a> and specifically claimed to clean it. We didn't try it because we'd already got rid of the problem by then but you could give it a shot, in case you're unlucky enough to get infected!<br />
<br />
It does seem a pretty simple thing to get rid of though so maybe this wasn't really required. I think if we'd simply renamed a copy of <span class="inline-code">cmd.exe</span> to something else, it would have bypassed the virus' blocks, so you might want to try that first :D</div><br />
<br />
<div class="nogooderrorbox"><span class="nogoodicon"> </span> EXE name : advirs.exe<br />
Location: c:\windows\system32\advirs.exe<br />
Registry Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Advirs</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com6tag:blogger.com,1999:blog-2091151685457159297.post-24310001036648031962008-05-17T00:06:00.004-04:002008-05-25T11:12:50.647-04:00Gmail Has A New Loading Page And Now Loads FasterWhen I logged into Gmail today, I noticed a different 'loading' page. Instead of the usual blank, there is now a progress bar visible.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj31HBgcIxkPaK13IYSykE9ExiHgvyT-83jDIN3orgWEvGhD7d3Qn3nTKBQHGXwT88A0FoK0zQuKF4zPyzCkHWxyO5kl1ihMXkZtqStw2b-CCiu4VCfF_lDweWkHGRDn2SDX5Wqp4XygNad/s1600-h/Gmail_New_Loading_Page.png"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXqsKlECqVyZ9g2xYzYn5bhz0PzCi-ywGsk1E5zBCAaJCAK0ZDPDWjUghL7sNNYbgWe1r0g3XmirqARrd4ZoUNWHhnBL44JLFM-wBek2UssPJqbKiPwAH6M8nKfrOeZQPfdW9RyEOkndR0/s320/Gmail_New_Loading_Page_Cropped.png" alt="Click To See The Complete Image of Gmail's New Loading Page" id="BLOGGER_PHOTO_ID_5204332165929475618" target="_blank" border="0" /></a><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSEl2VtPBB5Vlk4RKllqDuF2iQMPGL7HobKzp9rhw7EatC-NKCdTX1MB5-Tyt5PG1D2AXdD2opa70GEpSa8oZ46A6R8zQ2kglGymx4_pIdftacn4pza0i-ZlkCOafYDwLIga53MmMIXKbF/s1600-h/Gmail_New_Loading_Page_Taking_Longer.png"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKDOulS9gQhuvrCSnqAIz36TBnELepQAY8j8qM6IHsoRzLCJOxHB7jjaKjkZKFOPHWyCAnCvfEIySgVSantA68yw0KihXXWwplU4E-r2IahG1kGws2TlibRmkL40-DoIjUW_km1poH8pJP/s320/Gmail_New_Loading_Page_Taking_Longer_Cropped.png" alt="Click To See The Complete Image of Gmail's New Loading Page" id="BLOGGER_PHOTO_ID_5204332191699279426" target="_blank" border="0" /></a><br /><br />There also seem to be improvements behind the scene, as <a href="http://gmailblog.blogspot.com/2008/05/need-for-speed-path-to-faster-loading.html">this post on the Gmail blog explains</a>.no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com3tag:blogger.com,1999:blog-2091151685457159297.post-12389491180715961882008-05-01T12:39:00.004-04:002008-05-25T11:23:36.063-04:00Free Stuff For Your Domain<div style="text-align: justify;"><h3 class="post-title">Or What To Do With Your Domain Name, For Free</h3><br /><br />So you've finally got that really cool domain name you've always wanted; now what? How do you let everyone know how uber-cool you and domain name are? You could give some of these free services that allow you to use custom domains a shot.<br /><br />I <a href="http://tipsandtricks.nogoodatcoding.com/2007/06/nogoodatcodingcom.html">bought my domain </a>almost a year ago. I didn't really have anything specific in mind that I wanted to use the domain for, except perhaps <a href="http://blog.nogoodatcoding.com/">my blog</a>. I didn't want to shell out for hosting or other services that I wasn't really going to use but I also didn't want the domain name to lie idle. So I looked about for free services that I could use. I found only a few and they're listed below (mostly from Google!). The ones that I've not used are starred.<br /><br /><ul><li><span style="font-weight: bold;"><a href="http://www.google.com/a">Google Apps</a></span> - This is pretty much the best one in the list. It includes a lot of services. You get<br /><br /><ul><li><a href="http://gmail.com/">GMail</a></li><br /><li><a href="http://calendar.google.com/">Google Calendar</a></li><br /><li><a href="http://sites.google.com/">Google Sites</a></li><br /><li><a href="http://pages.google.com/">Google Page Creator</a></li><br /><li><a href="http://docs.google.com/">Google Docs</a></li><br /><li><a href="http://talk.google.com/">Google Talk</a></li></ul></li><br /><br /><li><span style="font-weight: bold;"><a href="http://domains.live.com/">Microsoft Windows Live Admin Center</a> ( formerly Windows Live Custom Domains ) *</span> - Microsoft's answer to Google Apps? You get some Windows Live services for your domain<br /><br /><ul><li><a href="http://mail.live.com/">Windows Live Hotmail</a></li><br /><li><a href="http://messenger.live.com/">Windows Live Messenger</a></li><br /><li><a href="http://contacts.live.com/">Windows Live Contacts</a></li><br /><li><a href="http://alerts.live.com/">Windows Live Alerts</a></li><br /><li><a href="http://photogallery.live.com/">Windows Live Photo Gallery</a></li><br /><li><a href="http://spaces.live.com/">Windows Live Spaces</a></li><br /><li><a href="http://www.microsoft.com/virtualearth/">Virtual Earth</a></li><br /><li><a href="http://calendar.live.com/">Calendar</a></li></ul><br /><br />This is what I could gather was being offered, the site is a bit confusing as to what exactly is up for use.</li><br /><br /><li><span style="font-weight: bold;"><a href="http://blogger.com/">Blogger</a></span> - The <a>http://myblog.blogspot.com</a> URL is, like, so ordinary, dude. Use Blogger's <a href="http://help.blogger.com/bin/answer.py?hl=en&answer=55373">custom domain feature</a> to publish your blog on <a>http://myblog.mydomain.com</a>. Your old BlogSpot URL is still valid, people will simply get redirected from there to the custom domain. ( I've noticed, however, that <a>http://www.myblog.blogspot.com</a> will NOT redirect! ) Blogger also supports redirection of feeds so if you're using the FeedBurner <span style="font-style: italic;">MyBrand</span> service, you could even redirect your Blogger feed to the one published on your custom domain!</li><br /><br /><li><span style="font-weight: bold;"><a href="http://feedburner.com/">FeedBurner</a></span> - After Google's acquisition, all the premium features are now free. So you can use the <span style="font-style: italic;"><a href="http://www.feedburner.com/fb/a/publishers/mybrand">MyBrand</a></span> service to change your feed address to something like <a>http://feeds.nogoodatcoding.com/nogoodtipsandtricks</a>; much better than <a>http://feeds.feedburner.com/nogoodtipsandtricks</a>, don't you think? Of course, you have to be using FeedBurner to publish your feeds!</li><br /><br /><li><span style="font-weight: bold;">Free Forum Hosting *</span> - I found these sites that offer free phpBB forums with custom domain name support.</li><br /><br /><ul><li><a href="http://www.freeforums.org/">FreeForums.org</a></li><br /><li><a href="http://www.prophpbb.com/">ProphpBB</a></li></ul><br /><br /><li><span style="font-weight: bold;"><a href="http://free-space.net/">Free-Space.net</a> *</span> - Free website creation and hosting; the pages are shiny!</li></ul><br /><br />One more advantage of putting your stuff on a custom domain name is that if you should ever choose to switch providers ( be it email, blogging platform, feed publisher, whatever ), all you need to do is update your domain settings to point that URL to the new host. Your friends and readers need not update anything!<br /><br />If you know of any other services that can be added to this list, post a comment! I'll add them to the list ( and credit you, of course :D ).<br /><span style="font-size:85%;"><br /></span><span style="font-weight: bold;font-size:85%;" >* I've not used these services but the sites seemed to indicate that they were free and had domain customization features.</span><span style="font-size:85%;"><br /></span></div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com1tag:blogger.com,1999:blog-2091151685457159297.post-40458222289403898252008-04-07T13:05:00.002-04:002010-05-22T20:41:03.289-04:00Yahoo! Messenger Doesn't Login? Check IE Proxy Settings<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_n4MjZPmFHIDWU-MapasWpaU-EUya-Eq2ZvhrU7IN7dEKg5B9rQjP713xsyaPFW3UBmxqa6Gid4SxdtqGsaDAtg9y6OF4ngm9hG_zK79lK7XtzKP5peVzzMIZHLZxTjjEPNgdcnbYJqay/s1600-h/Yahoo!+Messenger+Connection+Options.JPG"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_n4MjZPmFHIDWU-MapasWpaU-EUya-Eq2ZvhrU7IN7dEKg5B9rQjP713xsyaPFW3UBmxqa6Gid4SxdtqGsaDAtg9y6OF4ngm9hG_zK79lK7XtzKP5peVzzMIZHLZxTjjEPNgdcnbYJqay/s320/Yahoo!+Messenger+Connection+Options.JPG" alt="" id="BLOGGER_PHOTO_ID_5186019768100661154" border="0" /></a><br />
The other day, I wasn't able to login to Yahoo! Messenger on my company laptop. I fiddled around a bit and finally realized that I had the company proxy set in Internet Explorer. Once I cleared that, everything worked fine.<br />
<br />
Yahoo! Messenger has connection options for -<br />
<ul><li>No proxies</li>
<li>Use proxies</li>
<li>No network detection</li>
</ul>But it seems that even if you choose 'No proxies', the option doesn't override the proxy set in IE. Not very obvious and a potential blocker. Firefox does not cause this problem.no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com0tag:blogger.com,1999:blog-2091151685457159297.post-91928182677680853562007-09-04T13:11:00.002-04:002010-05-22T20:40:17.948-04:00Google Pages Site Sitemap<p align="justify">A little while ago, <a href="http://ai-onemansquest.blogspot.com/2007/08/google-pages-websites-for-free.html">Charles wrote a post on</a> <a href="http://pages.google.com/">Google Pages</a>. It <em>is</em> a rather cool service. And here's a cooler fact: it automatically generates a sitemap for you, which you can use for indexing with <a href="http://www.google.com/webmasters/">Google Webmaster Tools</a> or wherever else. If you frequently update, you could even use it as a feed of sorts.<br />
<br />
The sitemap file is called, wait for it, <span class="inline-code">sitemap.xml</span>! It won't show up in your 'Uploaded stuff' though ( since you obviously didn't upload it! ) but you can find it at <span class="inline-code">http://your.google.pages.sitename.googlepages.com/sitemap.xml</span>. But here's the worrying part; so can others. It's a public file and you have no control over the contents either. <em>All</em> your files will be listed in it. So for those of you that use the Google Pages space for storage, if it's stuff you don't others to find, don't put it up there. There's even <a href="http://gilles.rasigade.googlepages.com/gpexplorer">an iGoogle gadget</a> that lets your browse the contents using the sitemap. But of course, you could argue that if it's online, someone could find a way to get it, but there's a difference between leaving your front door open and locking it, knowing that a determined thief could break in anyway.<br />
<br />
Apart from <span class="inline-code">sitemap.xml</span>, there’s also an <span class="inline-code">rss.xml</span>. This one is also generated automatically but it contains entries of only your pages, not your uploaded files.</p><br />
<div class="nogoodnotebox"><div class="nogoodnoteboxcontent"><span class="nogoodicon"> </span>I first found out about <span class="inline-code">sitemap.xml</span> and the iGoogle gadget from <a href="http://www.consumingexperience.com/2007/04/googlepagescom-files-arent-private.html">A Consuming Experience</a>.</div><span class="footer"> </span></div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com0tag:blogger.com,1999:blog-2091151685457159297.post-67255600714801101912007-08-26T13:00:00.004-04:002010-05-22T20:37:29.891-04:00Finding Your Blogger blogId And postIds<p align="justify">Your Blogger <span class="inline-code">blogId</span> is your blog's unique identification number. You could change your blog URL and name but the <span class="inline-code">blogId</span> remains the same. You can find your Blogger <span class="inline-code">blogId</span> at quite a few places. The first is your blog's HTML source. Search for '<span class="inline-code">blogId</span>' and you'll find something like <pre class="brush: text">blogID=2091151685457159297</pre><br />
The next place to look is your <a href="http://www.blogger.com/home">Blogger Dashboard</a>. If you hover the mouse pointer over the <em>'Manage'</em> links ( i.e. the links for <span class="inline-code">Edit Posts</span>, <span class="inline-code">Settings</span> and <span class="inline-code">Layout</span> (or <span class="inline-code">Template</span> )), in the status bar, you should be able to see the <span class="inline-code">blogId</span> as part of the URL those links point to. Or you could <span class="inline-code">right-click</span> and select <span class="inline-code">Copy Shortcut</span> ( IE ) or <span class="inline-code">Copy Link Location</span> ( Firefox ). If you've followed any of those links, you'll also be able to see the <span class="inline-code">blogId</span> in your browser's address bar.<br />
<br />
Finally, you can also see your <span class="inline-code">blogId</span> on the comments link on your posts. It's part of the URL again, so use the same method as for the Dashboard.<br />
<br />
All your posts also have a unique id. The <span class="inline-code">postId</span>s are little harder to find. You can get them from the 'Manage Posts' page ( follow the <span class="inline-code">Edit Posts</span> link from your Dashboard). The <span class="inline-code">Edit</span> link for each post has the <span class="inline-code">postId</span> as part of the URL, you can view it in the status bar or by copying the link to a text-editor.<br />
<br />
Similarly, the <span class="inline-code">postId</span> can be found as part of links on your posts, the comments link, the <span class="inline-code">Email Post</span> link among others. In almost all cases, it'll be a parameter called <span class="inline-code">postId</span> in the destination URL. One exception is the <span class="inline-code">Subscribe to: Comments ( Atom )</span> on the individual post pages, where the <span class="inline-code">postId</span> would be the really long number in the URL. For example:</p><pre class="brush: plain">http://tipsandtricks.nogoodatcoding.com/feeds/6725560071480110191/comments/default</pre><p align="justify">Here, <span class="inline-code">6725560071480110191</span> is the <span class="inline-code">postId</span>.</p>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com6tag:blogger.com,1999:blog-2091151685457159297.post-38639500489524919042007-08-17T13:12:00.000-04:002008-04-06T02:46:43.801-04:00Customizing Mininova RSS Feeds<p align="justify">Mininova offers search-based feeds i.e. RSS feeds that can be generated according to some optional parameters.<br /><br />Mininova has two basic feed URLS; one is the global RSS feed at <strong>http://mininova.org/rss.xml</strong>. The second is the RSS feed for a search, found at <strong>http://mininova.org/rss/search+terms</strong>. Incidentally, I'm a big fan of their 'clean' URLs; very easy to use and very intuitive.<br /><br />Starting with the global feed, parameters that can be passed are:<br /><ul class="codeblock"><li><strong>cat</strong> : The category of the torrent. For example, 'Movies' are category 4.</li><li><strong>sub</strong> : The sub-category. For example, 'Action' movies are sub-category 1 while 'Animation' movies are 29. The sub-categories aren't necessarily in sequential order. Sub-category 2 is 'Trance/ House/ Dance' under the 'Music' category.</li><li><strong>user</strong> : The user name. For example, 'aXXo'. Case-insensitive, so you could use 'axxo' or 'AXXO'.</li><li><strong>num</strong> : The number of results you want returned. The default count is 20 items.</li><li><strong>direct</strong> : This is a new addition and doesn't take a value. It replaces the link of the feed item with the actual download URL ( you know, the one you see stating 'Download this torrent!' ) so that when you click on it, the download starts instead of you being taken to the 'General Information' page of the torrent.</li></ul>You can't really combine these parameters, but if you attempt to<br /><ul class="codeblock"><li>cat takes precedence over the others</li><li>user is ignored if either cat or sub is used</li><li>direct can be used with any of the others, either as the first parameter ( <strong>?direct</strong> ) or at the end ( <strong>?cat=1&direct </strong>)</li></ul>The search feed is much less customizable but you can easily find the button for the feed at the top of the search page, if you're not comfortable fiddling with the URLs. <ul class="codeblock"><li>Spaces are replaced by <strong>+</strong>'s</li><li>You can filter a category by simply adding the category number at the end of the URL like <strong>http://mininova.org/rss/search+terms/2</strong></li><li>Sub-categories don't seem to work, I was getting weird results with URLs like <strong>http://mininova.org/rss/search+terms?sub=35</strong> or <strong>http://mininova.org/rss/search+terms?cat=35</strong></li></ul>Well, that's all there is to it. Have fun. And if you find something else, lemme know!no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com4tag:blogger.com,1999:blog-2091151685457159297.post-7354514525974698872007-07-28T13:09:00.007-04:002010-05-22T20:26:12.557-04:00Basic Authentication For XDB Realm With Tomcat<div align="justify">I've seen a few people asking this question recently: <em>"When I try to access my instance of Tomcat with the URL <span class="inline-code">http://localhost:8080</span>, I get a dialog box asking for a username and password to log into the <span class="inline-code">XDB Realm</span>"</em>. Even with fresh installs, people face this problem.<br />
<br />
The problem is that by default, Oracle listens at port <span class="inline-code">8080</span>. And coincidentally, so does Tomcat, with default settings! And so, if you start Oracle first and Tomcat after, port <span class="inline-code">8080</span> is already in use when Tomcat tries to bind to it. In fact, if you look at the console or the logs, you'll see an error which says something like</div><br />
<pre class="brush: plain">Address already in use:JVM_BIND 8080</pre><br />
<div align="justify">When you try to access <span class="inline-code">http://localhost:8080</span>, you are actually trying to connect to Oracle and not to Tomcat. That's why none of the default username/password combinations that come with Tomcat work.<br />
<br />
The solution is simple: change the port that Tomcat listens on. This is assuming, of course, you want to use Oracle also. You could just get rid of it :D.<br />
<br />
Changing the port is simple. You'll find lots of detailed explanations if you Google'ed for it. But to give it in short, open <span class="inline-code">$CATALINA_HOME/conf/server.xml</span> and look for a line which starts with</div><br />
<pre class="brush: xml"><Connector port="8080"</pre><br />
<div align="justify">and change the port value to something different. I prefer using <span class="inline-code">8888</span>. It's so much easier to type than <span class="inline-code">8080</span> or <span class="inline-code">8081</span>!</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com11tag:blogger.com,1999:blog-2091151685457159297.post-57597157463985047792007-07-25T12:42:00.001-04:002010-05-22T20:13:04.749-04:00Escape Character In Microsoft SQL Server 2000<div align="justify">Here's something I was spent half a morning trying to find out: how do I escape a single quote (<span class="inline-code">'</span>) in Microsoft SQL Server 2000? I first tried the most obvious character- the backslash (<span class="inline-code">\</span>), but that didn't work. Then I randomly tried a few other characters but to no avail. So I ran a Google search but most of the stuff I got was for MySQL or Oracle and they seem to accept backslashes for escaping.<br />
<br />
I finally managed to discover that the escape character is, in fact, the single quote itself! So to insert a string with a single quote in it, you need to use an SQL query like:</div><br />
<pre class="brush: sql">INSERT INTO mytable ( randomstring) VALUES ( 'Where''s the answer?' )</pre><br />
<div align="justify">So now you know. What <em>I</em> want to know is, why couldn't they just use a backslash like everyone else?<br />
</div><br />
<div align="justify"><span style="font-size:85%;">You could also check <a href="http://sqlserver2000.databases.aspfaq.com/how-do-i-search-for-special-characters-e-g-in-sql-server.html">this article</a> out though it didn't really work for me but I didn't try that hard.</span></div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com34tag:blogger.com,1999:blog-2091151685457159297.post-25862040955505589252007-07-16T12:40:00.004-04:002010-05-22T19:28:41.369-04:00HTML Single Text Field Submit Caveat<div align="justify">This is something that I discovered by accident and thought it was a bug till I read this in the <a href="http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2">HTML specification</a>:<br />
<br />
<blockquote>When there is only one single-line text input field in a form, the user agent should accept Enter in that field as a request to submit the form.</blockquote><br />
I was using the name of the button clicked to identify the action to take when I started receiving a <span class="inline-code">null</span> value on some occasions. After a little investigation, I realized that if I clicked the button, the code worked fine; but if I pressed the <span class="inline-code">Enter</span> key while typing in the text field, I would get a <span class="inline-code">null</span> value for the button.<br />
<br />
If there is only one text field in a form along with a <span class="inline-code">submit</span> button, pressing <span class="inline-code">Enter</span> would cause a form submission as usual, but, the submit button would not be passed. The text field would be the recipient of the request to submit the form.<br />
<br />
Consider this simple form that submits to itself using the <span class="inline-code">GET</span> method ( default ) so that the query string can be used to easily verify the parameters being passed. <pre class="brush: xml"><html>
<body>
<form>
<input type="text" name="loneTextField" />
<input type="submit" name="theSubmitButton" value="Click Me" />
</form>
</body>
</html></pre>On clicking on <span class="inline-code">Click Me</span>, the query string is: <p class="codeblock">submitCheck.html?loneTextField=Test+Contents&theSubmitButton=Click+Me</p>whereas on pressing <span class="inline-code">Enter</span> in the text field: <p class="codeblock">submitCheck.html?loneTextField=Test+Contents</p>You can easily work around this though and it's not an issue if you don't need the button, but it's worth knowing.</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com7tag:blogger.com,1999:blog-2091151685457159297.post-23740809792797319182007-07-12T12:37:00.001-04:002010-05-22T19:24:01.893-04:00Wrapping Text In JLabels<div align="justify">I recently picked up Swing while I was developing <a href="http://www.nogoodatcoding.com/tweeter">Tweeter!</a>, a Java client for <a href="http://www.twitter.com/">Twitter</a>. A nifty little trick that I found out about was how to wrap the text inside a JLabel.<br />
<br />
JLabels support HTML markup. So all you need to do is surround the text with HTML tags ( <span class="inline-code"><html></span> and <span class="inline-code"></html></span> ) and voila! The contents wrap around! If you need it to be centered, simply add a <span class="inline-code"><center></span> tag. It's that simple!</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com1tag:blogger.com,1999:blog-2091151685457159297.post-27761891809157835112007-06-25T12:52:00.003-04:002010-05-22T19:37:21.178-04:00Yahoo! Mail Beta Login Workaround<div align="justify">I’ve always liked Yahoo! Mail, it’s fast and simple. I’d signed up for Yahoo! Mail Beta when I’d got the option but unfortunately, it seems to still have quite a few bugs in it and more often than not, I just see the welcome screen and nothing happens after that. None of the links respond and none of the buttons work.<br />
<br />
Now, I don’t want to opt out of the programme but I’m not really keen on having to clear my browser’s cache and reload every time I want to check my mail. So here’s what I do: as soon as the login process completes and I’m directed to the mail URL, something that looks like this:<br />
<p class="codeblock">http://us.mg2.mail.yahoo.com/dc/launch?.rand=tnrkit406744a</p><br />
I stop the page from loading and change the URL to this:<br />
<p class="codeblock">http://us.mg2.mail.yahoo.com/<i><b>ymv/login?ymv=0</b></i></p>i.e. add <span class="inline-code">ymv/login?ymv=0</span> to the end of the original URL. This takes me to the old Yahoo! Mail; speedy and simple. The URL may be slightly different; I used to get <span class="inline-code">http://us.f527.mail.yahoo.com/</span><br />
<br />
earlier but nowadays I seem to be getting redirected to this server. The technique works the same on both though.<br />
<br />
Yes, I know you can click on ‘Trouble logging in?’ and then ‘Check your email in original Yahoo! Mail’ but it takes too long that way and sometimes the page just doesn’t load.<br />
<br />
And anyway, you have to admit, this way looks much more impressive :D</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com3tag:blogger.com,1999:blog-2091151685457159297.post-32086428402400425262007-06-20T12:58:00.004-04:002010-05-08T22:54:36.413-04:00Converting Java Primitives To Strings<p align="justify">It’s fairly easy to convert the primitives in Java; <span class="inline-code">byte, short, char, int, long, float, double</span> and <span class="inline-code">boolean</span>, into <span class="inline-code">String</span>s; simply use the <span class="inline-code">toString()</span> method of the respective wrapper classes. But there’s a far easier way.<br />
<br />
It’s pretty well known that the <span class="inline-code">String</span> class overrides the ‘<span class="inline-code">+</span>’ operator for concatenation of strings. It’s also often mentioned that one should be careful while using code like</p><pre class="brush: java">String total = “The sum is ” + 2 + 4; </pre><p align="justify">since this will create the string as <span class="inline-code">“The sum is 24”</span> instead of the ( assumedly ) expected <span class="inline-code">“The sum is 6”</span> since the role of ‘<span class="inline-code">+</span>’ as the concatenation operator takes precedence over addition.<br />
<br />
This very side-effect can be utilized for all primitives. Simply concatenate the required primitive with an empty string ( <span class="inline-code">“”</span> ) and you get the value as a <span class="inline-code">String</span>! Consider the sample below:</p><pre class="brush: java">public class ConvertToString
{
public static void main(String[] args)
{
String finalOutput = "";
byte b = 1;
short s = 3;
char c = 'd';
int i = 14;
long l = 1234;
float f = 2.0F;
double d = 1.55;
boolean bn = true;
// finalOutput = b; //will not compile
// finalOutput = (String)b; //will not compile
// finalOutput = Byte.toString(b); //using the corresponding wrapper class
finalOutput = b + "";
System.out.println("The byte as String " + finalOutput);
finalOutput = s + "";
System.out.println("The short as String " + finalOutput);
finalOutput = c + "";
System.out.println("The char as String " + finalOutput);
finalOutput = i + "";
System.out.println("The int as String " + finalOutput);
finalOutput = l + "";
System.out.println("The long as String " + finalOutput);
finalOutput = f + "";
System.out.println("The float as String " + finalOutput);
finalOutput = d + "";
System.out.println("The double as String " + finalOutput);
finalOutput = bn + "";
System.out.println("The boolean as String " + finalOutput);
}
}
</pre><p align="justify">As you can see, there’s no need to be messing around with the wrapper classes. Admittedly, it’s not that big a deal, but it does make the code a little neater.</p>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com2tag:blogger.com,1999:blog-2091151685457159297.post-45782689203322091702007-06-17T12:55:00.001-04:002010-05-22T19:15:43.662-04:00Solution For Slow Hibernation<div align="justify">Ever since I've been using Windows XP, I've been a fan of the '<a class="acronym" href="http://en.wikipedia.org/wiki/Hibernate_(OS_feature)">Hibernate</a>' feature since it significantly speeds up the boot time of my machines ( shutdown may be a little slower though, but it's worth it. Also, it may actually lead to slower booting on some machines; you'll have to try it out ).<br />
<br />
A little while ago though, I faced a very frustrating problem: Windows would take almost 10 minutes to hibernate. And it was really weird because I had reinstalled Windows a few days earlier and it had been working absolutely as expected ( notice I didn't say 'fine'; not with Windows :D ). I couldn’t' for the life of me figure out what had gone wrong.<br />
<br />
After a little bit of Google'ing, this is the solution I discovered: you need to have 'write caching' enabled for the drive. After reinstalling, I'd turned this off and when I turned it back on, hibernation was as fast as it had been before.<br />
<br />
To turn on write-caching for a drive under Windows XP ( I'm using Windows XP Professional ):<br />
<br />
<span class="inline-code">Right-click</span> the icon in <span class="inline-code">My Computer</span> > <span class="inline-code">Properties</span> option > <span class="inline-code">Hardware</span> tab > <span class="inline-code">Properties</span> button > <span class="inline-code">Policies</span> tab > Check the <span class="inline-code">Enable write caching on the disk</span> checkbox<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKQ9pPRaW0rDgcFtrKeCYImTVqRMtjcOyhFpQh4KfUXl_dUPLeLyOmc24lj637OE3Zm50h6ifaoDxLXWlY74RnFZOjYLbywSxu9j3jLdijZ_3qfXsot2E3BPqSx9i1oX12A9EbxoMKDIb8/s800/Enable_Write_Caching.JPG"><img id="BLOGGER_PHOTO_ID_5077039750486445042" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="Enable Write Caching" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKQ9pPRaW0rDgcFtrKeCYImTVqRMtjcOyhFpQh4KfUXl_dUPLeLyOmc24lj637OE3Zm50h6ifaoDxLXWlY74RnFZOjYLbywSxu9j3jLdijZ_3qfXsot2E3BPqSx9i1oX12A9EbxoMKDIb8/s400/Enable_Write_Caching.JPG" border="0" /></a><br />
<br />
To enable hibernation under Windows XP ( I'm using Windows XP Professional ):<br />
<br />
<span class="inline-code">Right-click</span> on your <span class="inline-code">Desktop</span> > <span class="inline-code">Screen Saver</span> tab > <span class="inline-code">Power</span> button > <span class="inline-code">Hibernate</span> tab > Check the <span class="inline-code">Enable Hibernation</span> checkbox<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL7l67NlK6lHpKu8mbq8tRkfI20oZ5FsOafHUyLNkrPR-QXe-xL5Yn0czzIU_jF7sHFv8YHw6VVH7IBy8jte5VXwUI-Zj0-FXo5DFhLttTAGGVp4Tyn9CC8Y5imJg7l8mamQgPGqQ6e_IP/s800/Enable_Hibernation.JPG"><img id="BLOGGER_PHOTO_ID_5077039750486445058" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="Enable Hibernation" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL7l67NlK6lHpKu8mbq8tRkfI20oZ5FsOafHUyLNkrPR-QXe-xL5Yn0czzIU_jF7sHFv8YHw6VVH7IBy8jte5VXwUI-Zj0-FXo5DFhLttTAGGVp4Tyn9CC8Y5imJg7l8mamQgPGqQ6e_IP/s400/Enable_Hibernation.JPG" border="0" /></a> </div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com2tag:blogger.com,1999:blog-2091151685457159297.post-73653318272079098772007-06-15T13:12:00.000-04:002008-04-06T02:46:43.811-04:00NoGoodAtCoding.com<div align="justify">I own it! The <em>it</em> in question being the domain name '<a href="http://www.nogoodatcoding.com/">nogoodatcoding.com</a>'. I bought it yesterday and I've been fooling around with ever since. It's made me aware of a whole new dimension to the Internet. I'm still in the process of setting stuff up and so I guess I'll be a little busy for a while...which means no long, drawn-out posts :D<br /><br />I have managed to publish <a href="http://blog.nogoodatcoding.com/">both my blogs</a> to custom domains using the feature offered by Blogger. There will be a few hiccups though; notably with images loading. I've also noticed that if you type in the blog's original, blogspot name with a 'www.' prefixed, it doesn't redirect to the custom domain.<br /><br />Also, the blogs may simply not be available as the propagation of the changes across the DNS over the Internet takes some time; most sites I've seen say 24-48 hours, a couple stated up to 72 hours. Though I've already checked that a few people can already access these, it may still take sometime. Actually, if you're reading this, it's already happened; and if you weren't, well, then you wouldn't have known what was happening. :D<br /><br />I think this post is getting close enough to being drawn-out now; and my domain settings beckon!</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com0tag:blogger.com,1999:blog-2091151685457159297.post-44013897779390502007-06-14T12:53:00.000-04:002008-04-06T02:46:43.812-04:00What This Blog Is About<div align="justify"><a href="http://blog.nogoodatcoding.com/">My original blog</a> is an account of what I'm all about. I recently decided to start posting little tips and interesting stuff relating to technology that I use and some, rare snippets of curious code. It was immediately obvious to me that it would be out of place on that blog. So I started another; this one that you're reading now.<br /><br />The posts may not be regular or even frequent. You may not think them smart; some may even seem lame. But it's something that I think I'm going to enjoy doing and so I will.<br /><br />Well, so that is what it's all about; tips and tricks and other interesting things that I pick up as I make my way through it all.</div>no.good.at.codinghttp://www.blogger.com/profile/04460714365540022556noreply@blogger.com0