My Tiny Lab LLChttp://mytinylab.com
enHow to install Tomato Shibby in an ASUS RT-N66U routerhttp://mytinylab.com/node/20
<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>Recently I flashed Tomato Shibby in an Asus RT-N66U router. To save you a pain and time here is what worked for me. </p>
<ul><li>Download the latest Tomato Shibby firmware for the ASUS RT-N66U, file tomato-K26USB-1.28.RT-N5x-MIPSR2-140-AIO-64K.zip, from <a href="http://tomato.groov.pl/download/K26RT-N/build5x-140-MultiWAN/Asus%20RT-N66u%2064k/">http://tomato.groov.pl/download/K26RT-N/build5x-140-MultiWAN/Asus%20RT-N...</a></li>
<li>Unzip the .trx file and save it somewhere in your PC</li>
<li>Plug the Ethernet cable to LAN 1 of the router and the other end to the Ethernet port on your PC. </li>
<li>Turn on the router</li>
<li>Open a web browser to 192.168.1.1 and login into the router with user admin and password admin.</li>
<li>Unplug the power cable from the router.</li>
<li>Place the router in recovery mode: hold the reset button and then plug the power back. Keep the reset button pressed all this time while you wait for the power icon to blink very slowly. It could take 10 seconds for you to see it blinking very slowly.</li>
<li>Refresh the browser page (192.168.1.1).</li>
<li>Download the ASUS firmware restoration utility from Asus website (<a href="https://www.asus.com/us/Networking/RTN66U/HelpDesk_Download/">https://www.asus.com/us/Networking/RTN66U/HelpDesk_Download/</a>) or install it from the CD included with your router.</li>
<li>Run the ASUS firmware restoration utility and start flashing the Tomato .trx file you unzipped. Some people say it will complain that it's incompatible software. Ignore that message if you see it. I didn't see that message.</li>
<li>It will take maybe 15+ minutes for the firmware to get installed on the machine. Once the ASUS Firmware restoration is done unplug the ethernet cable from the PC. That seems to make the router reset faster. Leave the router alone until it resets itself. With the ethernet cable plugged in it seemed to take 30+ minutes for the firmware to take. With the ethernet cable unplugged it took maybe 5 minutes (I don't remember , but it was a lot faster).</li>
<li>Refresh the browser page and log into Tomato Shibby.</li>
</ul></div></div></div>Thu, 22 Jun 2017 20:56:27 +0000Alfredo20 at http://mytinylab.comhttp://mytinylab.com/node/20#commentsMigrating from ASPTear to MSXML2.ServerXMLHTTPhttp://mytinylab.com/node/19
<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>So I had to migrate some classic ASP code that uses ASPTear to instead use MSXML2.ServerXMLHTTP. ASPTear was used to get some HTML newsletters and email them. The problem was that there were strange characters returned by MSXML2.ServerXMLHTTP for any character above 127. After some digging online, turns out we have to get the data as binary and not as text and then convert the binary data into a string. I also decided to convert characters above 127 into this representation, &amp;#127, to be sure they will display well in the emails. Hopefully this will help someone out there who's also migrating to MSXML2.ServerXMLHTTP.</p>
<p><strong>ASPTear example code:</strong></p>
<blockquote><p>
Dim objTear, myResponse<br />
Dim myURL, Request_POST, Request_GET, strQueryStringOrPostData, strUsername, strPassword</p>
<p>Set objTear = CreateObject("SOFTWING.ASPtear")<br />
myURL = "<a href="http://yourwebsite.com">http://yourwebsite.com</a>"<br />
Request_POST = 1<br />
Request_GET = 2<br />
strQueryStringOrPostData = "&amp;param=value"<br />
strUsername = "theusername"<br />
strPassword = "thepassword"</p>
<p>myResponse = objTear.Retrieve(myURL, Request_GET, strQueryStringOrPostData, strUsername, strPassword)
</p></blockquote>
<p><strong>MSXML2 example code:</strong><br />
So be aware that responseText in MSXML2.ServerXMLHTTP assumes data is ASCII, so chars above 127 come back as 255. To solve that problem get the data using responseBody and then convert binary to a string. Below is an example:</p>
<blockquote><p>
Dim objTear, myResponse,<br />
Dim myURL</p>
<p>Set objTear = CreateObject("MSXML2.ServerXMLHTTP.6.0")<br />
myURL = "<a href="http://yourwebsite.com">http://yourwebsite.com</a>"<br />
objTear.Open "GET", myURL, False<br />
objTear.send ""</p>
<p>' Convert binary result to string.<br />
myResponse = Stream_BinaryToString(objTear.responseBody, "iso-8859-1")</p>
<p>Sub Save2File (sText, sFile)<br />
Dim oStream<br />
Set oStream = CreateObject("ADODB.Stream")<br />
With oStream<br />
.Open<br />
.CharSet = "iso-8859-1"<br />
.WriteText sText<br />
.SaveToFile sFile, 2<br />
End With<br />
Set oStream = Nothing<br />
End Sub</p>
<p>'Code from <a href="http://www.motobit.com/tips/detpg_binarytostring/">http://www.motobit.com/tips/detpg_binarytostring/</a><br />
'Stream_BinaryToString Function<br />
'2003 Antonin Foller, <a href="http://www.motobit.com">http://www.motobit.com</a><br />
'Binary - VT_UI1 | VT_ARRAY data To convert To a string<br />
'CharSet - charset of the source binary data - default is "us-ascii"<br />
Function Stream_BinaryToString(Binary, CharSet)<br />
Const adTypeText = 2<br />
Const adTypeBinary = 1</p>
<p> 'Create Stream object<br />
Dim BinaryStream 'As New Stream<br />
Set BinaryStream = CreateObject("ADODB.Stream")</p>
<p> 'Specify stream type - we want To save text/string data.<br />
BinaryStream.Type = adTypeBinary</p>
<p> 'Open the stream And write text/string data To the object<br />
BinaryStream.Open<br />
BinaryStream.Write Binary</p>
<p> 'Change stream type To binary<br />
BinaryStream.Position = 0<br />
BinaryStream.Type = adTypeText</p>
<p> 'Specify charset For the source text (unicode) data.<br />
If Len(CharSet) &gt; 0 Then<br />
BinaryStream.CharSet = CharSet<br />
Else<br />
BinaryStream.CharSet = "us-ascii"<br />
End If</p>
<p> 'Open the stream And get binary data from the object<br />
Stream_BinaryToString = BinaryStream.ReadText<br />
End Function
</p></blockquote>
</div></div></div>Tue, 20 Jan 2015 03:08:39 +0000Alfredo19 at http://mytinylab.comhttp://mytinylab.com/node/19#commentsUsing PHP to change file and directory permissions in a web serverhttp://mytinylab.com/Using%20PHP%20to%20change%20file%20and%20directory%20permissions%20in%20a%20web%20server
<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>Here is a PHP script to recursively change file and directory permissions in your web server. This is useful for Drupal users who have their sites hosted in web hosts that don't allow them to easily do a recursive chmod. This version is based on the one posted at <a href="http://drupal.org/node/34028">http://drupal.org/node/34028</a> and is geared towards Drupal users. </p>
<p>This version will change the file and directory permissions to chmod 0555. If you need to change the permissions to something else, like chmod 0755, to work on the files just replace 0555 with 0755 in the script. It will skip the files at the root folder and it will also skip the "sites" directory and its files and sub directories. This is so that you can set those files to have different permissions or not mess up the current permissions they have (some people have "private" directories inside their "sites" directory).</p>
<p>To use the script, place it in your root Drupal folder, where the Drupal files are. Then in your browser visit <a href="http://yoursite.com/thisscript.php">http://yoursite.com/thisscript.php</a>, where <strong>yoursite</strong> is the name of your website and <strong>thisscript</strong> is the name you gave this script. Delete the script from the server when you are done.</p>
<blockquote><p>
&lt;?php<br />
// code based on <a href="http://drupal.org/node/34028">http://drupal.org/node/34028</a><br />
// this version skips the sites folder<br />
// pass current directory<br />
file_fix_directory(dirname(__FILE__));</p>
<p> function file_fix_directory($dir, $nomask = array('.', '..')) {<br />
if (is_dir($dir)) {<br />
if ($dir != dirname(__FILE__)){<br />
// Try to make each directory 0555 except the root dir and its files<br />
if (@chmod($dir, 0555)) {<br />
echo "&lt;p&gt;Made 0555: " . $dir . "&lt;/p&gt;";<br />
}<br />
}<br />
}</p>
<p> if (is_dir($dir) &amp;&amp; $handle = opendir($dir)) {<br />
while (false !== ($file = readdir($handle))) {<br />
if (!in_array($file, $nomask) &amp;&amp; $file[0] != '.') {<br />
if (is_dir("$dir/$file")) {<br />
// skip "sites" folder, its subdirectories, and its files<br />
if ($file != "sites"){<br />
// Recurse into subdirectories<br />
file_fix_directory("$dir/$file", $nomask);<br />
}<br />
}<br />
else {<br />
if ($dir != dirname(__FILE__)){<br />
$filename = "$dir/$file";<br />
// Try to make each file 0555<br />
if (@chmod($filename, 0555)) {<br />
echo "&lt;p&gt;Made 0555: " . $filename . "&lt;/p&gt;";<br />
}<br />
}<br />
}<br />
}<br />
} // while</p>
<p> closedir($handle);<br />
}<br />
} // function<br />
?&gt;
</p></blockquote>
</div></div></div>Mon, 21 Jan 2013 15:30:14 +0000Alfredo18 at http://mytinylab.comhttp://mytinylab.com/Using%20PHP%20to%20change%20file%20and%20directory%20permissions%20in%20a%20web%20server#commentsBackgammon - an HTML/Javascript game for mobile and desktop browsershttp://mytinylab.com/Backgammon%20-%20an%20HTML/Javascript%20game%20for%20mobile%20and%20desktop%20browsers
<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div style="float:left;margin: 0 10px 0 0;"><a href="http://mytinylab.com/out/backgammon/index.htm"><img class="size-medium wp-image-62" title="backgammon" src="http://mytinylab.com/sites/default/files/images/blog/backgammon.png" alt="" width="250" height="250" /></a></div>
<p>Go to <a href="http://mytinylab.com/out/backgammon/index.htm">http://mytinylab.com/out/backgammon/index.htm</a> to play backgammon with a friend. You can play it on Android (tested on Firefox in a Galaxy S2) or a desktop (tested in IE9, Firefox, and Chrome). The default Android web browser and Dolphin don't show the board image for some reason. I'll look at that problem at some other time. Until that's fixed use Firefox on Android.</p>
<p>Note that I said "play ... with a friend." The code has no logic regarding the rules of the game. It just simulates a physical backgammon board. You and your friend take care of the rules and moving the pieces.</p>
<p>The code is taken from other sources and modified to fit my needs. The original code was written by <a href="http://www.webreference.com/programming/javascript/mk/column2/index.html">Mark Khan</a>. My contribution was to make draggable elements you click come to the front of everything else. So, if you have several images that can be dragged then clicking on an image will bring it to the front of other images. This is useful in doll-dressing games or doll-house games (show a piece of furniture in front of or behind other pieces of furniture). I haven't seen this feature in any other drag and drop Javascript code. Minor contributions were the backgammon theme, pieces, and dice.</p>
<p>The bit of Javascript code that handles mobile is from <a href="http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript/">Ross Boucher</a>. It makes drag and drop work in mobile devices by translating mouse events to mobile events. Without this code the game will only work on desktop browsers.</p>
<p>There you have it, a physical backgammon board and pieces simulation written in HTML and Javascript that allows drag and drop in mobile and desktop browsers with the added benefit that elements can be brought to the front. Enjoy the code!</p>
</div></div></div>Sat, 26 May 2012 20:47:28 +0000Alfredo17 at http://mytinylab.comhttp://mytinylab.com/Backgammon%20-%20an%20HTML/Javascript%20game%20for%20mobile%20and%20desktop%20browsers#commentsGoogle Take Me Awayhttp://mytinylab.com/20100629_googleTakeMeAway
<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div style="float:left;margin:0 10px 0 0;"><img class="alignleft" title="Calgon take me away!" src="http://www.mysupermarket.co.uk/Images/ExternalImages/ProductsDetailed/76/031876.jpg" alt="" width="170" height="167" /></div>
<p>There are rumours that Google is creating another social media website, called Google Me. There is an article about it on <a title="Google Me PC World article" href="http://www.pcworld.com/article/200111/google_me_facebookkiller_or_another_johnnycomelately.html?tk=hp_new">PC World</a> and Kevin Rose talked about it on <a href="http://twit.tv/254">TWIT episode 254</a>. Looks like Kevin Rose tweeted about Google Me and was asked by Google to remove the Tweet.</p>
<p>What about Google's current social website, Orkut? I think it will be merged into Google Me or become Google Me. Maybe it will be same social website, but with two names: Orkut and Google Me.</p>
<p>Facebook is no longer cool. Recently, my wife's cousins were teasing each other on their wall and their mother ended the teasing by posting something like "now girls, remember you only have each other." These "girls" are in their mid 20's and early 30's. To me, that's the point when Facebook jumped the shark.</p>
<p>Facebook is no longer behaving like a true social network. Once you have everyone mixed in the same conversation (family, friends, significant other, boss, co-workers) we either shut up or just talk about the weather and sports. I have noticed that the wall postings in Facebook have become unimportant nothings and some people have stopped posting.</p>
<p>Google Me is coming in at the right time. I'm ready to leave Facebook. Google Me, take me away!</p>
<p>UPDATE (2015/08/10): So what happened 4 years after writing this blogpost? I was wrong. Facebook did not jump the shark. Google Me is Google Plus. I'm still using Facebook because most of my family and friends is using Facebook. Most of the Facebook postings are still unimportant nothings, but there are also very important somethings. I also realize the importance of unimportant nothings because they are like chit chat with friends. Some of my friends and family are also in Google Plus, so I use both Google Plus and Facebook. Orkut has been closed. </p>
</div></div></div>Tue, 29 Jun 2010 05:00:00 +0000Alfredo9 at http://mytinylab.comhttp://mytinylab.com/20100629_googleTakeMeAway#commentsFour Online Security Toolshttp://mytinylab.com/20100224_fourOnlineSecurityTools
<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>To surf securely on a Windows XP machine I use:</p>
<ol><li><a href="http://www.mozilla.com/en-US/firefox/personal.html">Firefox</a> (<a href="http://www.mozilla.com/en-US/firefox/personal.html">http://www.mozilla.com/en-US/firefox/personal.html</a>) a browser that allows you to include several useful add-ons.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/722">NoScript</a> (<a href="https://addons.mozilla.org/en-US/firefox/addon/722">https://addons.mozilla.org/en-US/firefox/addon/722</a>). A Firefox add-on that prevents Firefox from running JavaScript and Flash on a website unless you give it permission to run JavaScript or Flash on that website.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1865">Ad Block Plus </a>(<a href="https://addons.mozilla.org/en-US/firefox/addon/1865">https://addons.mozilla.org/en-US/firefox/addon/1865</a>). Removes all ads from a website.</li>
<li><a href="http://www.sandboxie.com/">Sandboxie</a> (<a href="http://www.sandboxie.com/">http://www.sandboxie.com/</a>). A sandbox from which you can run Firefox.</li>
</ol><p>Sandboxie creates a virtual area on your computer (in computer terms that's called a sandbox) from which you can run programs. Programs run in the sandbox thinking they are running on your computer. When a program wants to read a file from your computer the sandbox gives them a copy to read. When a program wants to create or modify a file on your computer, the sandbox creates that file in the sandbox. So if a program in the sandox wants to put a virus on your computer it ends up putting it in the sandbox.</p>
<p>Now, this is important to know. A sandbox protects your computer from getting permanently infected by malware, but it doesn't protect your information from being read. So, if a virus gets into your sandbox it will do its viral things, but once you delete that sandbox instance the virus will be completely gone and any changes it tried to do to your computer will be gone. A sandbox is not an anti-virus program. A sandbox runs programs as if they were running from your computer, but without allowing the program to make permanent changes to the computer. To make all or some of the changes permanent, you have to manually allow them by righ-clicking on the files created or modified and selecting "Recover to Same Folder" or "Recover to Any Folder".</p>
<p>By running Firefox from Sandboxie, any changes a website does to your computer or to Firefox stays in the sandbox and doesn't get to your computer. This prevents malware coming from a website to permanently infect your computer or Firefox.</p>
<p>JavaScript is a computer language used in websites that makes a website behave like an application. The problem with JavaScript is that in the wrong hands it can be used to infect your computer. NoScript allows you to control which websites can run JavaScript and which ones can't. For trusted sites you can tell NoScript to always allow JavaScript, like Amazon and Google. For non-trusted websites, e.g. one someone sent you on an email or that you clicked for curiosity, you can just let NoScript disallow JavaScript until you can decide if it should be trusted or not.</p>
<p>Flash is a computer program that can also run from your browser. This is what makes it so powerful and so dangerous in the wrong hands. NoScript can also prevent Flash from running on a website unless you allow it.</p>
<p>There have been several infections caused by advertisement on reputable websites. Ad Block Plus prevents ads from running on a website. You won't see the ads anymore on a website unless you allow the ads to show. It's not as important as NoScript, but it gives you that extra security until the day ad agencies can determine if an ad carries malware or not.</p>
<p>If you have to choose only one of the tools above, choose Sandboxie. It will prevent malware to make permanent changes to your computer. If you want to be safer, use all four tools. Be aware that these tools are a little complicated to use at first, so make sure you read their user manuals. Once you get used to them you will feel naked browsing without them.</p>
</div></div></div>Wed, 24 Feb 2010 06:00:00 +0000Alfredo5 at http://mytinylab.comhttp://mytinylab.com/20100224_fourOnlineSecurityTools#comments