Day 3 Redbrands Investigation

This is a character log for Genesis Fletcher, a D&D 5e sorcerer


In the morning, I am awakened hearing Mara yelling for Rei to come down. Rei, being hungover, doesn’t hear her- forcing her to come up stairs to wake him up. I listen in at the doorway to my room. Cheryl was still sound asleep, despite the yelling woman in the next room.

(OOC: A little while later)

Mara and the Inn Keeper head down to the cellar. I follow to see what’s going on. The Inn Keeper shows us the two goblins passed out drunk/hungover and demands us clean up his Inn. We agree and drag the two goblins to the town master.

While there, we ask the town master about a gang that supposedly has been causing problems around town. He seemed like he was too scared to talk about them.

Day 2 Delivery Complete

This is a character log for Genesis Fletcher, a D&D 5e sorcerer.


The others woke up early and decided to head back to the cave in search of our two goblin ‘friends.’

When we got there, the cave was clear of everyone but the two goblins the others befriended. They took us to the big one’s sleeping chambers. We searched the chambers for anything worth taking. (OOC Someone, Mara I think) found a frog-shaped object made of some green substance.

After we thoroughly searched the cave, we decided to head into Phandalin and complete the job we were hired to complete.

(OOC: A few hours later)

Cheryl remained behind with the two goblins because we didn’t want them getting into trouble.

The rest of us arrived in town and delivered the cart to the shop keeper who was eagerly awaiting the supplies. He paid us and we left to find the local Inn as it was late. Rei went back to get Cheryl and the goblins– as he was leaving, I saw him transform into a black creature that ran on 4 legs, truly astounding.

We grabbed a table at the Inn and got dinner and a drink. A short while later, we notice the door to the Inn open and in the light we could see Cheryl, Rei, and the two goblins. Mara didn’t look pleased and tried to ignore them, until they called out to us. They joined us at our table, and Rei started drinking. A lot…

The Inn Keeper wasn’t pleased seeing the goblins. He approached us and asked us to remove them from the sight of his guests. Rei stepped up and asked for a room for them, and haggled over a price.

Sildar mentioned something about a wizard friend of his had gone missing from the area a few weeks ago– that’s why he was here, to look for him. We suggested we ask around town first thing in the morning.

We get rooms for the night and bunk up 2×2.

End of Day 2

Day 1 Continued

This is a character journal entry for “Genesis.” In the future, I’ll try to keep these together if the days are split up between sessions.


After a few minutes rest to search the cavern, we decide to make our way back to the clearing outside the cave. Rei, Mara, and I decide to slide down the cliff face we had previously climbed. Mara took a bit of a tumble and nearly passed out. As Cheryl was about to climb down with Sildar–the man whom was tied up in the corner of the cavern–a beastly looking man-goblin thing appeared next to Cheryl with two angry looking wolves. Cheryl was rendered unconscious, forcing someone, Rei, to pull on the rope tied around Cheryl’s arm to pull her down with the rest of us. Mara runs out of the cave very fast, fearing for her life.

We heard the beastly man-goblin-thing shout out “Break the dam.” I motioned with my staff an incantation to re-enforce the previous ice wall I had built. It’s about this time that someone comes running up towards us, a woodly looking elf by the name of Farah, looking to assist us. Farah helped Rei carry Cheryl, while I grabbed Sildar by myself. We booked it out of the cave as fast as we could muster. We met up with Mara outside who was already preparing the cart. Farah and Rei hoisted Cheryl into the cart while I helped Sildar into the front of the cart to ride with Mara. Farah sat in back with Cheryl to make sure she doesn’t slide out.

Rei and I stayed behind to make sure no one followed. Though after a while, Rei decided to make a dash for the cart and I followed.

We all met up shortly after and decided to continue on the road quickly. Around sun down, we made camp for the night. Farah took first watch. The rest of us ate some rations and went to sleep. Cheryl laid unconscious for several hours until we were all awakened by the man goblin thing from before and his pack of wolves. Two archers fired arrows at Farah, but missed. I ran up and cast my blinding spell in front of the pack of wolves. Unfortunately, I was just a few feet shy of hitting the man goblin thing. The wolves were blinded though!

The others made pretty quick work of things. The two archers ran off after the big guy fell over dead. Farah managed to pacify one of the wolves and is trying to tame it as a pet. It’s very sickly; it’s previous masters starved it in order to make it more fierce.

We then rested for the night.

Day 1 – The Start of an Adventure

The following is a journal entry for the character “Genesis” in a D&D game.


A dwarf named Gundren Rockseeker hired myself and a group of adventurers to escort a cart from Neverwinter to Phandalin. When I went to pick up the cart and begin my journey, Gundren introduced me to the others: Cheryl (half-elf ranger). Mara (half fire elemental, half human warrior), and Rei (human druid). They all appeared to be fairly young, maybe in their twenties. We set off shortly after meeting.

An day or so into the journey we came across a broken cart in the middle of the road. The horses that were hitched to the cart were dead — shot with black arrows by goblins. The passengers were no where in sight, unfortunately. I suspected they either managed to escape and run away or were captured by the goblins — I hope it was the former.

While we were investigating the cart wreck, we were ambushed by two goblin scout archers. The others made short work of them. Rei decided searched the cart for anything of use. Afterwards, Cheryl, Rei, and Mara ran off into the forest following tracks of the goblins. I opted to stay with our cart. I parked the cart near an old tree out of sight of the road.

Some time passed before Cheryl met up with me again. She came to get me and the cart. Together, we continued into a clearing next to a river. Mara and Rei had captured a goblin watchman and was holding it down so it wouldn’t try to escape. The others managed to get information out of it; they lived in a cave nearby – the entrance was where the river came out of the mountain which was guarded by a couple wolves. Rei gave the goblin a hunk of horse meat and told it to run off away from the cave.

As we ventured into the cave, we noticed the pack of wolves that were sleeping nearby. One of them made a slight movement as if it were going to wake up, but Rei or Mara tossed it a piece of jerky to satisfy it. I was sweating at this point because I was surely going to be the wolf’s first meal should it have awakened. But we soon passed the wolves den, but we were spotted. A few seconds later, we heard a rush of water coming towards us. All of us, except Rei of course, ran for cover in a little alcove on the other side of the river. Rei got washed a little bit down river, though I was able to save him in the nick of time using my shaped water by freezing the oncoming water into a wall to allow him to recover and get over to us.

Once Rei was safe and back with us, we noticed a cave wall behind us. Cheryl decided to try to show off and climb it–twice– only to fall half way down. Mara tried next and fell too. Rei then tried as well but chickened out when he touched the wall—I think he’s afraid of heights. As the weakest of the group, I was hesitant to try after seeing them all fail. Fortunately, thanks to my training with Ferrath up in the Ice Mountains and Cheryl’s and Mara’s clumsiness knocking the loose rocks down, I was able to climb the rock face without breaking a sweat. I was about to turn around and gloat to my comrades below, but I noticed an encampment ahead and managed to duck behind cover before anyone saw me. Rei followed quickly afterwards, but wasn’t nearly as quiet and managed to alert the goblins to our presence. Luckily I was still out of sight. Cheryl and Mara quickly climbed up and were greeted by a couple goblins ready to attack. Rei threw up a shield in a Phalanx motion to protect them as they climbed up.

Mara and Cheryl took turns trying to dish out damage. Mara got beat up pretty badly, but fortunately Rei was there to drop a healing ward for her. I tried to help with magic, but didn’t want to risk hitting one of my friends. Instead, I reached for one of my daggers and tried to strike one of the heavier looking goblins, but I must’ve knicked it’s shield because nothing happened. Fortunately, the others were able to take out the immediate threats. Two archers remained. Rei or Mara tried to talk them down, but weren’t having much luck. At best, they lowered their bow slightly. I was able to convince them that we weren’t a threat, to which they laid their bows on the ground.

I noticed a guy over on the side. He was in rough shape from the quick glimpse I caught. Rei tried to treat him, but he was quite injured. We decided to make camp for the night.

While we made camp, Rei talked the two goblins into coming with us to kill Klarg, their boss.

[PHP] Sitemap generator for directory listing

Sitemaps are lovely, aren’t they? Not so easy to generate (or *gosh* make manually). Being a programmer, I decided to write a little PHP script to generate one on the fly for a massive (almost 3,000 files) downloads site that I host for gamers. There’s a download link attached to this post, but here’s a look at the code from above.

It has one dependency of phpURI which I use to generate the links for urlset:url::loc elements in the XML. It also uses PHP’s XMLWriter to generate the actual XML for the sitemap.

// BEGIN CONFIG OPTIONS
$default_change_freq = 'monthly';
$url_prefix = 'http://downloads.cncfps.com/';
$blacklist = array('cgi-bin');
// END CONFIG OPTIONS

require_once(realpath('../phpuri.php'));

$filter = function($info, $key, $iter)
{
    global $blacklist;
    if (preg_match('/^..*/', $info->getFilename()))
    {
        return false;
    }

    if($iter->hasChildren() && !in_array($info->getFilename(), $blacklist))
    {
        return true;
    }

    return $info->isFile();
};

$dirall = new RecursiveDirectoryIterator('./', RecursiveDirectoryIterator::SKIP_DOTS | RecursiveDirectoryIterator::KEY_AS_PATHNAME);
$dir = new RecursiveCallbackFilterIterator($dirall, $filter);
$files = new RecursiveIteratorIterator($dir);

header('Content-Type: application/xml');

$writer = new XMLWriter();
$writer->openURI('php://output');
$writer->setIndent(true);
$writer->startDocument('1.0', 'UTF-8');
$writer->startElementNS(NULL, 'urlset', 'http://www.sitemaps.org/schemas/sitemap/0.9');

$writer->startElement('url');
$writer->writeElement('loc', phpURI::parse($url_prefix)->join('sitemap.xml'));
$writer->writeElement('lastmod', date(DateTime::W3C));
$writer->writeElement('changefreq', 'always');
$writer->endElement(); // <url></url>

foreach($files as $file => $object)
{   
    $writer->startElement('url');

    $furi = phpURI::parse($url_prefix)->join($file);
    $furi = htmlentities($furi, ENT_COMPAT | ENT_XML1); //$furi = rawurlencode($furi);

    $writer->writeElement('loc', $furi); // <loc></loc>
    $writer->writeElement('lastmod', date(DateTime::W3C, $object->getMTime())); // <lastmod></lastmod>

    // TODO: read filename.ext.txt for metadata
    $writer->writeElement('changefreq', $default_change_freq); // <changefreq></changefreq> 

    $writer->endElement(); // </url>
}

$writer->endElement(); // </urlset>
$writer->endDocument(); // EOF
$writer->flush();

exit;

Right now, it generates the sitemap on the fly, and only lists files found in the current directory (recursively). I do have plans to add support for per-file configuration (perhaps even per-directory configurations) via “filename.extension.txt” to change things like changefreq and priority per-file.

If you want to change this to run as a cron script, simply change $writer->openURI('php://output'); to $writer->openURI('sitemap.xml'); and it will write the sitemap out to a file (note, appropriate server permissions for writing are needed). If you do this, be sure to remove the sitemap.xml entry from the script.

Of course, if you use on the fly generation, you’ll probably want to use URL rewriting to map /sitemap.xml to /sitemap.php instead. The following is the Apache .htaccess config for such.

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteBase /
    RewriteRule ^sitemap.xml$ sitemap.php [L]
</IfModule>

Download: sitemapgen.zip

Science Fiction – Exploring who WE are

Science Fiction – Exploring who WE are

Perhaps my favorite quote of all time (so far) comes from a scene in Star Trek: Enterprise when Ambassador Soval and Admiral Forrest are entering the Earth embassy on Vulcan. They are discussing the perception of Humans by Vulcans.

Soval: “We don’t know what to do about Humans. Of all the species we’ve made contact with, your’s the only one we can’t define. You have the arrogance of Andorians, the stubborn pride of Tellarites; one moment, you’re as driven by your emotions as Klingons, and the next you confound us by suddenly embracing logic.”

Forrest: “I’m sure those qualities are found in every species.”

Soval: “Not in so confusing abundance.” Forrest: “Ambassador, are Vulcans afraid of Humans?”

Soval: *nods*

Forrest: “Why?”

Soval: “Because there is one species you do remind us of.”

Forrest: “Vulcans.”

Soval: “We had our wars, Admiral, just as Humans did. Our planet was devastated, our civilization nearly destroyed. Logic saved us. But it took us almost 1500 years to rebuild our world and travel to the stars; you Humans did the same in less than a century. There are those on the High Command who wonder what Humans will achieve in the century to come and they don’t like the answer.”

Forrest: “We’re not the Klingons. We only want to be your partners, to do what the nations of Earth have learned to do: To work together in common cause.”

Soval: “Unfortunately, the future of relations between our two worlds is not mine to control.”

It really opened my eyes to what Star Trek represents, as well other science fiction shows such as the Stargate series. These science fiction entertainment shows help us to understand ourselves by putting us in front of a mirror to analyze our own behavior. I think this quote explains that perfectly and I hope your outlook on these shows changes as it has mine.

Self-install/Self-setup PHP Installation

Recently, I decided to give IIS another try in preparation for learning the WCF Framework. I also decided to try PHP as well with IIS (7.5 in this case).

Unfortunately, I ran into some issues with installation as I tried to install PHP 5.4 along with IIS. The actual installation and use of PHP worked, however, I couldn’t figure out why PHP was looking in “C:WINDOWS” for my php.ini, rather than the actual directory where I (then) extracted PHP to. I noticed later, when I downgraded to 5.3 since it had an installer available, rather than just a .zip download.

If you are setting up PHP with IIS, manually or via installer, you need to log the HTTPd’s account out of Windows and back in again. The issue mentioned above is PHP is looking for “php.ini” in “C:WINDOWS” which is undesirable. The PHP 5.3 installer edits your Windows PATH environment variable to include “C:PHP” (or wherever you installed PHP). Windows doesn’t associate this change until you logout and log back in again.

If you happen to install it manually, edit your path variable to include your PHP directory. See the screenshot for other details that would be useful.

This was done on Windows 7 Professional, 64-bit.

array_walk Usage

Alright, so I was confused by the PHP Docs on array_walk. So, I wrote a little example to try to figure out how it works. I did so because the PHP documentation on the function was a bit unclear in my opinion.

The basic structure for array_walk is:

array_walk( array $myarray, function(&$val, $key) );

That said, you can see my usage here and the corresponding output it provides.

WordPress Theme & Javascript Bloginfo

Alright, I’m pretty sure this has been done before.

Scenario: I need to access bloginfo() function from inside a script block on my custom theme.

Solution (partial): A partial solution to this is easily remedied with minimal code. However, this solution only allows default bloginfo() to be retrieved.

The following function goes inside your theme’s functions.php file:

function get_the_bloginfo_array()
{
    static $_bloginfo = array( 'name', 'description', 'admin_email', 'url', 'wpurl',
                        'stylesheet_directory', 'stylesheet_url', 'template_directory', 'template_url',
                        'atom_url', 'rss2_url', 'rss_url', 'pingback_url', 'rdf_url', 'comments_atom_url',
                        'comments_rss2_url', 'charset', 'html_type', 'language', 'text_direction', 'version' );
    $jsArray = array( );

    foreach ($_bloginfo as $key)
    {
        $jsArray[$key] = get_bloginfo($key);
    }

    return json_encode($jsArray);
}
var bloginfo = <?php echo get_the_bloginfo_array();?>

 

 

TeamSpeak 3 Server on Debian Squeeze

UPDATE: 2012.12.23 – Updated package links for x86 and x64 packages.

UPDATE: 2015.02.19 – As of a few patches ago, TeamSpeak 3 now linked against the correct MySQL binaries.

Well, I due to a recent run of bad luck on my current VPS host, I was forced to go looking for a new server. I found one to which I was referred to by another customer and a friend of mine—the host is known as NFO Servers.

Anyway, when I finally got the server setup enough to be able to start setting up individual servers on it, I got the MySQL Database all setup and configured in my TS3 server config files…I kept getting the following error:

INFO    |DatabaseQuery |   | Please make sure you use the supplied ts3server_minimal_runscript.sh to run the server, or set LD_LIBRARY_PATH yourself CRITICAL|DatabaseQuery |   | unable to load database plugin library “libts3db_mysql.so”, halting!

I searched on the Google for answers and found some random and unhelpful posts from TeamSpeak 3’s Official forums – though, they were slightly helpful, but weren’t specific enough to provide a one-stop solution.

The problem as stated in this forum thread is as follows:

TeamSpeak uses libmysqlclient.so.15 but Debian Squeeze serves libmysqlclient.so.16.

“No problem, right? Just do what he says to do in the next line and you’ll be all setup.” — Nope. For those of you who are sort of new to Linux, like myself, you don’t know what “the old Lenny repository” is that he’s talking about. I tried to find the repository from the Google again, but to no avail, I tried the next best thing: Installing the package via wget and dpkg directly, and, Voila! It worked!

Download one of the following packages (based upon your distribution):

Example:

wget -O libmysqlclient15off.deb http://archive.debian.org/debian/pool/main/m/mysql-dfsg-5.0/libmysqlclient15off_5.0.51a-24+lenny5_amd64.deb

In the same location of wherever you are currently when you downloaded the package,

mv libmysqlclient15off_5.0.51a-24+lenny5_i386.deb libmysqlclient15off.deb
dpkg --install libmysqlclient15off.deb

And this will install the missing dependency for your new TS3 server.

If my post is unclear in any instructions, drop a comment and I’ll try to explain it better for future people. Thanks for reading!