Skip to main content
 

Windows Integration Authentication Scheduled Web Page

This is a problem I have been trying to solve for some time on and off. Under Windows/IIS I need to periodically run a webpage that uses Windows Integrated Authentication. This rules out most of the VBS scripts and WGet solutions. I got it to work today using a batch file like below. Just add it as a scheduled task.

start /min "C:\Program Files\Internet Explorer\iexplore.exe" http://domain.com/webpage
PING 1.1.1.1 -n 60 -w 60000 > NUL
taskkill /F /IM iexplore.exe

The two most important parts is starting the application with the 'start' command (windows 2003 server in this case) so that the batch file will continue while the program is running. We then use a trick by pinging every second for 60 seconds (1 minutes) to wait for the webpage to finish what it's doing. Finally we kill off the original program.

 

[Plugin: WP List Files] Fix: links don't work when blog not installed in root of site

wp-list-filesUpdate: This plugin is no longer available.

We’re using a customized version of WordPress as an electronic portfolio for students and we are using WP List Files to make documents available on the ePortfolio. Unfortunately the WordPress support forums seem to hide my topic (possibly because it's an older version) and the author is no longer supporting the plugin.

Due to time constraints, these plugins are no longer supported and will not be updated, ever! Unless you know what you’re doing, I strongly discourage using these on a production blog since they have not been tested since WordPress 2.5.

The plugin didn't work in version 2.0.3 that we are using because the wp_enqueue_script function does not exist in this version  (the codex page does not say when this function was added). Anyway after manually adding the JavaScript to the theme's head element the plugin almost worked fine - links didn't take our folder structure into account.

works:
joeblogs.com</dir specified in post or page>

doesn't work:
allblogs.com/blogs/joebloggs</dir specified in post of page>

Fix it by replacing line 231 to read:

$files .= '

  • wpurl').$item['link'].'">'.$itemName.''.

 

The hyperlink created for the item didn’t have the complete blog URL in it. It assumed the blog was installed in the root of the domain. After this fix the plugin works fine.

 

Amasan's WordPress Tweak Roundup

Made few tweaks to improve the blog in preperation for several drafts I'm currently working on. Here's a quick rundown for everyone that's interested in the wordpress blog platform.

  • Related Posts should show up to 5 related posts without too many false positives on single article pages. I like how this plugin scores posts on relativity and that I can set it to show nothing when no posts are related, which keeps the interface clutter to a minimum.
  • A single easy recognisable block of Google Adsense adverts has been added to single articles. You won't see it if you have Adblock Plus installed like myself, but it should give helpful suggestions on articles with a single subject and support hosting costs in the process.
  • Template tweak: Moved post-meta-information from under the title to the footer (tag/cat info) so that the header is better connected with the body of the post. There's enough clutter on other sites.
  • I've visually combined  categories and tags underneath articles. Category are used for url purposes and tags  to facilitate cross linking of subjects. No need for two lists.
  • I added a tagcloud to the site so you can browse the site and discover some other articles. I don't think browsing by time and month is useful to many people so that's been removed from the site. The only concern I have at the moment is that the cloud would grow to too big a list, so in the future I might just show the top 7 tags used. For now that's not a problem.
  • PHP Speedy. This is the most important reason why the site is so snippy.

There's more but I'll save them for another time.

 

Wordpress for iPhone Impressions

I'm currently testing the Wordpress iPhone app (WfI). It's great for a free app! However I noticed a few things that need to be polished:

  • It didn't retrieve the blogs categories from my blog and the category I added to this post wasn't saved.
  • The interface is a bit slow on the frontpage when clicking an option it doesn't turn blue immediately
  • There's currently (18th June 2009) no way to edit the blog's details after setting up, or ability to remove it that I have found. I changed my user's password but I cannot change it in WfI! An Edit button on the blog selection screen would definately help in this case. I'll have to remove the application and redownload it - maybe that helps.

Still it's a great way to do some writing while not at a desktop and I appreciate the offline mode for iPod Touch users.

 

Site updates

I had a problem with my site and it has been restored to 4th January. Sorry for any inconvenience.

 

Letter to Ministry of Sound

Dear sir/madam,
I am writing you to complain about the new ministry of sound website and the lack of data protection with regards to your users.

Earlier today I received an email notification about the new MoS website. The email also notified me that a new password was issued to use on the website. These are two characteristics of a phishing mail - in this case launching a new website and sending out new passwords, they could easily have been sent from a malicious source wanting me to login to their MoS-lookalike website and take my credit card details. You shouldn't send out a new password unless someone requests it on your website, because email can be forged. You also sent out my password in plain text email rather than on a secure part of your website. Anyone can read it and login to my account and purchase orders.

Also to my surprise while investigating the source of the mail, several of the links point to a http://www.c-f-1.com/ domain (update: this domain name no longer exists!), the name doesn't help to improve the trust in your email. To my astonishment the link led to a webpage with the html email, again with my password in plain sight. Have a look (link removed), I changed my password already. Let's wait for Google to index it so that anyone can search for my account information. They already found other newsletters.

Finally, I used mosdownload.com to buy my mp3s online. This site no longer works as an error comes up when it tries to redirect, due to a configuration error. My order history is gone, most of my profile is gone.

I'm very disappointed with your lack of security and care for your customers and unfortunately have come to the conclusion that I won't be using your service again, and I will recommend my friends and family to do the same, due to these trust issues.

 

Fixing Trac after upgrading VisualSVN

If you upgraded VisualSVN Server like I have today to 1.61 and have Trac installed as per VisualSvn+Trac then you’ll notice Trac stopped working.

To fix this, follow this part of the instructions:

Add following line at the top of file C:\Program Files\VisualSVN Server\httpd-wrapper.bat:

set PYTHONHOME=%~dp0\Trac\python

Update: Later updates to VisualSvn Server break Trac.

 

My thoughts exactly

Eurogamer writes:

The community has also pointed out that SecuROM does nothing to stop piracy, as Spore was cracked before public release. Instead, they argue, the real target is the pre-owned, trade-in market.

 

TracFogbugzPlugin 0.9u-py2.5 Patch for Trac 0.11

If you use both VisualSvn + Trac (or another flavour of Subversion and Trac), and tried to integrate them with Fogbugz , you will have tried the TracFogbugzPlugin.

Trying to get this to work isn’t straightforward as it’s not compatible with Trac 0.11. You will come across the following error:

Traceback (most recent call last):
File "C:\Python25\Lib\site-packages\trac\web\api.py", line 339, in
send_error
'text/html')
File "C:\Python25\Lib\site-packages\trac\web\chrome.py", line 684, in
render_template
data = self.populate_data(req, data)
File "C:\Python25\Lib\site-packages\trac\web\chrome.py", line 592, in
populate_data
d['chrome'].update(req.chrome)
File "C:\Python25\Lib\site-packages\trac\web\api.py", line 168, in
__getattr__
value = self.callbacks[name](self)
File "C:\Python25\Lib\site-packages\trac\web\chrome.py", line 460, in
prepare_request
for category, name, text in contributor.get_navigation_items(req):
File
"c:\Python25\lib\site-packages\tracfogbugzplugin-0.9u-py2.5.egg\fogbugz\fogb
ugz.py", line 22, in get_navigation_items
yield 'mainnav', 'fogbugz', Markup('<a href="%s">FogBuz</a>',
self.baseurl)
LookupError: unknown encoding: >/">https://<<myurl>>/

To fix this line 22 needs changed, to read:

yield 'mainnav', 'fogbugz', Markup('<a href="%s">FogBuz</a>'%self.baseurl)

Or download the file below and use it as part of the installation instructions (if this is your first Python Egg you want to read about installing Trac plugins. ;)

Now it is loading but the plugin doesn't seem to work, haha.

Download: Patched tracfogbugzplugin-09u-py25

 

Passing and receiving multiple values to VbScript functions

Maintaining code can be a real pain in backside. Especially when you’re using shared code, almost always at a later date you will want to make the code more versatile to accommodate a scenario you hadn’t thought of before.

I’ve had experience this in an ASP / VbScript environment, and therefore I’m going to use the terminology of page and functions as opposed to files and classes:

  1. Rework the code and update all pages. This is obviously a bad idea.
  2. To extend inflexible code: Rename the function and create a wrapper in its place to access the function using default parameters that are compatible with your existing codebase.
  3. Create functions that are extendable.

To use optional parameters, pass them in an Array or dictionary object. This way you can add additional ones. The benefit that Arrays have over Dictionary objects is that they use less resources. This can be important if you are developing for a popular website.

Another advantage of using Arrays is that you’ll use less code calling the function. Using a dictionary object you’ll have to add each parameter separately, then pass the dictionary object as the parameter of the function.

On the other hand, code will be more legible using dictionary objects. Dictionary objects use  key value pairs to tell you that key A has a value B. You’ll not have to bother about the order of parameters, but you’ll have to know the keys of each function. It results in verbose, legible, resource intensive code.

 

Blocked Adsense to end bloggers revenue?

commerce Just been reading Gizmo's article on disabling Google's text advertisements. I'm realizing it has come this far: people have been increasingly annoyed by advertising on their favourite websites. N now even Google's textads are targeted because a small percentage puts the ads on the page people have become annoyed. So they disable the ads. That's their right.

However that leaves millions of bloggers without a possible revenue stream to support their writing so I am thinking what it can be replaced with. I've no idea. Personally I wouldn't donate to a website because I liked a certain article, donationware works best for 'tools'. I don't think I can get paid for putting legitimate search results underneath a post, which would be a benefit to readers, which is a shame. Subscription services go against the nature of the web (hiding content from public). I wouldn't buy a mug just because i read a website. Maybe that means that it's just too hard for an individual to recoup their costs?

That said, the majority of people will not have Adsense blocked. And I think the majority of bloggers don't blog for money, but because they like to discuss.

Credit: Photo by mwagner01

 

Rewarding feedback

Acquiring feedback on web projects can be harder than you'd think, especially when you're working on internal projects that don't get discussed on outside your organization. By making feedback a fun, easy and rewarding thing to do more people might be encouraged to help us and put in the effort.

I'm sure some of you are in a similar situation: you launch a project and silence follows. Trivial problems might emerge but a there's no general response to the long hours you put in. That makes it much harder to evaluate the project and set a schedule for future developments.

To help with this we've created a UserVoice page. Let's describe it as a digg-like FAQ. People are encouraged to leave a message, can vote on feedback they find important, and always have the full picture of what the development is focused on. Developers act on the consensus and theoretically will work on solving the most urgent issues.

Of course this model will work best when both users and developers care enough to communicate. So Uservoice is engineered to make it trivial to leave a message. It can be easily integrated into an existing site. Some functionality requires a user account, which is a stumbling block. But you can leave feedback without it, which is a bonus. Oh and it doesn't integrate with any bug trackers which is a shame.

Will it work and will there be enough participation? Ask me again in 6 months time. I'm not sure how to make it any easier though.

 

Radiohead - Nude by Epson, HP, Spectrum and Harddrives

James Houston, a Glasgow School of Art's graphic design graduate created a  live performance of Radiohead - Nude on a bunch of pc components. Very impressive.

Sinclair ZX Spectrum - Guitars (rhythm & lead)
Epson LX-81 Dot Matrix Printer - Drums
HP Scanjet 3c - Bass Guitar
Hard Drive array - Act as a collection of bad speakers - Vocals & FX

 

LSL tests: recursive function

It's good practice to make code easy to maintain, so sometimes you'll want to use less code using recursive functions. In order to find out how to this works in Second Life I created this small recusive example:

integer i = 0;
integer top = 0;
integer Monkeys()
{
    llOwnerSay("monkeys");
    i++;
    if (i <= top)
        return Monkeys();
    else
        return i;
}
default
{
    state_entry()
    {
        llSay(0, "Hello, Avatar!");
    }
    touch_start(integer total_number)
    {
        i = 0;
        top = Monkeys();
        llOwnerSay((string)top);
    }
}

This script says monkeys an increasing amount of times every time you touch it by calling itself if and keeping track of the total amount of times the function is called. First time there will be 1 monkey, next time 2 monkeys etc. Find more products at our shop in Badmoon.

 

LSL tests: walking states

I had to create a simple script to turn a neon sign on and off. I decided to have both versions of the sign in a single texture and changing the offset with a script. Instead of using a timer and using llSetTimeout() instead I opted to pause the script for a small amount of time. The script does not respond when it's sleeping which should be less laggy then the timeout. All i do then at the start of a state is offsetting the texture to show the on/off alternatively.

default
{
    state_entry()
    {
        llOffsetTexture(0.0,0.25,ALL_SIDES);
        llSleep(1.37);
        state off;
    }
}

state off
{
    state_entry()
    {
        llOffsetTexture(0.0,0.75,ALL_SIDES);
        llSleep(.723);
        state default;
    }
}

Hope this is of use to you. See the result in our Higher / Lower game at Badmoon.

 

Youtube Dreamweaver CS3 Tips

Brian Wood presents an excellent Dreamweaver tips video on Youtube. Many people just use DW as a text-editor but it's capable of a lot more even in code view. The following video might open your eyes:

Very nice.

 

Recommended: Instapaper

I'd like to start recommending webservices  and software that I use frequently. Any product recommended has been evaluated for at least several weeks. In today's recommended we feature Instapaper. (Recommendation articles are personal opinions with no benefit for the author)

What does Instapaper do? Instapaper facilitates easy reading of long text content.

We discover web content throughout the day, and sometimes, we don’t have time to read long articles right when we find them.

Instapaper allows you to easily save them for later, when you do have time, so you don’t just forget about them or skim through them.

http://www.instapaper.com/

 

Piracy and pc gaming

Interesting article regarding piracy and pc gaming:

Recently there has been a lot of talk about how piracy affects PC gaming. And if you listen to game developers, it apparently is a foregone conclusion - if a high quality PC game doesn't sell as many copies as it should, it must be because of piracy.

Now, I don't like piracy at all. It really bugs me when I see my game up on some torrent site just on the principle of the matter. And piracy certainly does cost sales.  But arguing that piracy is the primary factor in lower sales of well made games? I don't think so. People who never buy software aren't lost sales.

Is it about business or glory: http://draginol.joeuser.com/article/303512/Piracy_PC_Gaming

 

It should be free?

Should simple software be free:

During the chat, the entire MacBreak Weekly crew discussed the danger to the music industry that comes from younger listeners having a built-in expectation that music should be free.

On this episode I believe [Leo Laporte] has inadvertently helped to perpetuate the same kind of thinking about software that the panel had just finished expressing concern about with regard to music: the idea that the hard-earned fruits of somebody’s creative labor should be free.

http://www.red-sweater.com/blog/481/it-should-be-free

 

Getting started with Powershell

PowerShell is a complete replacement for any of Microsoft's DOS or Windows command line interpreters. It is a full fledged object oriented system administration scripting language. With PowerShell knowledge you would run circles around any sysadmin that works predominantly from through the GUI, as well as be able to get Windows to do things that you just can't do through a GUI alone.

http://www.microsoft.com/technet/scriptcenter/topics/msh/cmdlets/index.mspx