Archive

Archive for December, 2010

Recursively listing directories in PHP

Just a simple PHP script to list directories two level deep:

$dir = dirname(__FILE__).’/’;

// Open a known directory, and proceed to read its contents
if (is_dir($dir))
{
if ($dh = opendir($dir))
{
while (($file = readdir($dh)) !== false)
{
if (filetype($dir . $file) == “dir” && $file !== “.” && $file !== “..” && $file !== “images”)
{
echo “<li>$file</li>”;
$dh2 = opendir($dir . $file);
echo “<ul>”;
while (($file2 = readdir($dh2)) !== false)
{
if ($file2 !== “.” && $file2 !== “..”)
{
echo “<li><a href=’$file/$file2′>$file2</a></li>”;
}
}
closedir($dh2);
echo “</ul>”;

}
}
closedir($dh);
}
}

I’ve used this to help index the 80 GB or so files I’ve now recovered from the GEOCITIES torrent

Which I’ve indexed from A to Z 

     Sunday, October 14, 2012 11:17 AM        <dir> 0
     Monday, October 15, 2012  3:10 PM        <dir> 1
     Sunday, October 14, 2012 11:18 AM        <dir> 2
     Sunday, October 14, 2012 11:19 AM        <dir> 3
     Sunday, October 14, 2012 11:20 AM        <dir> 4
     Sunday, October 14, 2012 11:20 AM        <dir> 6
     Sunday, October 14, 2012 11:20 AM        <dir> 8
     Sunday, October 14, 2012 11:20 AM        <dir> 9
     Monday, October 15, 2012  3:09 PM        <dir> _
     Monday, October 15, 2012  4:53 PM        <dir> a
     Monday, October 15, 2012  5:06 PM        <dir> b
     Monday, October 15, 2012  5:21 PM        <dir> c
     Sunday, October 14, 2012  3:33 PM        <dir> d
    Tuesday, October 16, 2012  3:37 AM        <dir> e
     Monday, October 15, 2012  3:54 AM        <dir> f
    Tuesday, October 16, 2012  3:48 AM        <dir> g
    Tuesday, October 16, 2012  3:50 AM        <dir> h
    Tuesday, October 16, 2012  4:35 AM        <dir> i
    Tuesday, October 16, 2012  4:54 AM        <dir> j
     Monday, October 15, 2012  5:38 AM        <dir> k
    Tuesday, October 16, 2012  5:55 AM        <dir> l
     Monday, October 15, 2012  7:40 AM        <dir> m
     Monday, October 15, 2012  7:47 AM        <dir> n
     Monday, October 15, 2012  9:36 AM        <dir> o
     Monday, October 15, 2012  9:43 AM        <dir> p
     Monday, October 15, 2012 12:20 PM        <dir> r
     Monday, October 15, 2012 12:45 PM        <dir> s
     Monday, October 15, 2012 12:52 PM        <dir> t
     Monday, October 15, 2012  2:26 PM        <dir> u
     Monday, October 15, 2012  2:30 PM        <dir> v
     Monday, October 15, 2012  2:34 PM        <dir> w
     Monday, October 15, 2012  2:34 PM        <dir> x
     Monday, October 15, 2012  2:50 PM        <dir> y
     Monday, October 15, 2012  2:59 PM        <dir> z
Advertisement
Categories: Uncategorized

Free FTP account

Here is a free FTP account, anyone can use it to upload anything…

  • FTP Username: free@wikiencyclopedia.net
  • Password: nniyadiloh
  • FTP Server: ftp.wikiencyclopedia.net
  • FTP Server Port: 21

FAQ:
Why?
– I’ve got ample space on this server, I’m willing to share with others.

Is it private?
– Nope, anyone can access it, delete your files that you uploaded, rename them, download them, whatever

Can I access this over a browser?
http://www.wikiencyclopedia.net/free is the root.

Can you help me install WordPress / Joomla / Whatever?
– Nope.

Can I upload dodgy stuff?
– It will be deleted, and your IP blocked, all uploads are moderated.

Want to try it out now, you can use http://ftp.apixml.net

Categories: Uncategorized

Unlimited webspace hosting

Here are another 35 websites I’ve rescued from the Geocities torrent. The next recovery looks huge … 65 GB of sites, which

    Friday, October 12, 2012 11:21 PM        <dir> 0
     Friday, October 12, 2012 11:22 PM        <dir> 1
     Friday, October 12, 2012 11:24 PM        <dir> 2
     Friday, October 12, 2012 11:24 PM        <dir> 3
     Friday, October 12, 2012 11:26 PM        <dir> 4
   Saturday, October 13, 2012  6:17 AM        <dir> _
   Saturday, October 13, 2012  7:18 AM        <dir> a
   Saturday, October 13, 2012  1:25 AM        <dir> b
   Saturday, October 13, 2012  7:21 AM        <dir> c
   Saturday, October 13, 2012  1:41 AM        <dir> d
   Saturday, October 13, 2012  7:36 AM        <dir> e
   Saturday, October 13, 2012  7:43 AM        <dir> f
   Saturday, October 13, 2012  2:38 AM        <dir> g
   Saturday, October 13, 2012  2:41 AM        <dir> h
   Saturday, October 13, 2012  8:05 AM        <dir> i
   Saturday, October 13, 2012  3:40 AM        <dir> j
   Saturday, October 13, 2012  3:41 AM        <dir> k
   Saturday, October 13, 2012  4:36 AM        <dir> l
   Saturday, October 13, 2012  4:43 AM        <dir> m
   Saturday, October 13, 2012  4:45 AM        <dir> n
   Saturday, October 13, 2012  6:05 AM        <dir> o
   Saturday, October 13, 2012  6:07 AM        <dir> t
   Saturday, October 13, 2012  6:07 AM        <dir> v
   Saturday, October 13, 2012  6:08 AM        <dir> x
   Saturday, October 13, 2012  6:09 AM        <dir> z
Categories: Uncategorized

Iterating HTMLSelectElement options in C# And VB.NET

If you want to list all the values of options in a HTML drop down list, from a webbrowser control in VB.NET or C#, here’s how to do it:

Dim hoeDest As HTMLOptionElement
For iDest = 0 To hseDestinations.options.length – 1
hoeDest = hseDestinations.options.item(iDest)
tbOutput.Text += hoeDest.value
Next iDest

Or in C#

for (var iDest = 0; iDest <= destinationSelect.Children.Count – 1; iDest++)
{
var hoeDest = (HTMLOptionElement)destinationSelect.Children[iDest].DomElement;
tbOutput.Text += hoeDep.value;
}

 

Categories: Uncategorized
%d bloggers like this: