Mediaportal MP-TVSeries Re-Import Bugfix

This is largely for my own records, but someone might find it useful:

Manual Solution for problems re-importing after delete. This bug occurs with v2.6.0 when you delete a show from your database and then attempt to reimport it. It appears to detect the files, but doesn’t identify them as needing to be imported. This is due to an issue whereby the records aren’t correctly removed from the TVSeries database.

Use at your own risk.

  1. Make backup of your “TVSeriesDatabase4.db3” (always a good thing anyway)
  2. Download an SQLite tool, such as SQLite Browser.
  3. Make sure no instance of MP-TVSeries is running (otherwise bad things will happen), then File -> Open Database -> locate and open the “TVSeriesDatabase4.db3” file.
  4. Click on the “Execute SQL” tab, and copy and paste the following command:
    DELETE FROM local_episodes WHERE (SELECT COUNT(*) FROM local_series WHERE local_series.id = local_episodes.seriesid) = 0;
    and click on “Execute query” button.
  5. Save the database and close SQLite Browser
  6. Open MP-TVSeries config and re-run the import wizard, and everything should work again.

To see which episodes did not get properly deleted before you remove them, change “DELETE FROM” into “SELECT * FROM” and it will show you.

The selected task “{0}” no longer exists

Ever since my power supply blew up and took my system down rather unexpectedly, I’ve been getting an error message every time I open up Task Scheduler in Windows 7; specifically “The selected task “{0}” no longer exists”. I’ve looked all over the place for a solution, but the majority of them just consist of identifying and deleting the missing tasks from the file system, which isn’t ideal when you’ve got loads of built-in system tasks that probably do importantish things.

So, brain was engaged, files were examined and a solution was found:

  1. Run Task Scheduler (TS)
  2. When the error(s) appear, dismiss them
  3. Navigate to each folder and subfolder in turn until you get the error message. Note the folder name and any tasks that *do* display
  4. Exit TS
  5. Open Explorer and navigate to %windir%\system32\tasks\ and then down to the folder from #3
  6. Cut & Paste the files that *aren’t* displayed in TS to a temporary location (Make sure you Cut and not Copy)
  7. Re-open TS, dismiss any errors and navigate back to the folder from #3, which should now open without any errors
  8. Right-Click on the folder and choose “Import Task”
  9. Set the “File Type” selection to “All Files” and then select the file you cut in #6, then OK the imported task. Repeat for any other tasks in that folder
  10. Return to #3 until all folders have been checked and you should now be able to open TS without any errors and without having lost any tasks

Note: I found that several of the tasks that I had created myself had “lost” their scheduling information (No “Next Run” time) and I had to open them, make an arbitrary change to the “Trigger” settings and then re-save them to put them back on track again.

Update: Fuck it, the same problem has come back again – it’s obviously something more serious than a one-off file corruption.

Dear Developers…

Dear Developers,

If you’re going to port your shiny new game to the PC it might be worth bearing in mind the following points:

  • Most PC gamers don’t have Xbox controllers, so it’s nice to make your game playable if they have to use a keyboard and mouse
  • On the subject of mice, they’re a bit more precise than Xbox controllers, so let me change my bloody sensitivity
  • Computers have been doing “HD” since about 1998, give me resolutions above 1080p
  • Computers have lots of buttons on their keyboards, please don’t make me use Space for every single sodding action
  • Performance. Computers can have it if you put some effort in. When I can’t run your game at 1280×1024 on average detail settings, you’ve done something very wrong.
  • Please let me save my game more often. I understand that you don’t want to remove the tension by going back to the days of 24/7 quicksaving, but when your badly ported game inevitably crashes, I’d rather not have to replay the last hour of the game just to get back to where I was (knowing there’s a fair chance it’ll just crash again at the same point).

I’m thinking in particular about Alpha Protocol at the moment, which despite its faults is a really fun game, but I’ve had to spend hours searching various forums & blogs and modifying .ini files just to make the mouse usable. Even after all that, the performance is still pretty shitty and most of the options in the game don’t actually do what they say they do – oh and if you somehow manage to force FSAA on, all your dialogue choices vanish so you can’t really play any more.

Yours.
Adam.

Google Apps for Domains Having Serious Issues

Many people, including myself, seem to be having major issues with Google Apps for domains at the moment; starting last Friday (7th), my Nexus One logged itself out of Google Talk and refused to log back in, the Pidgin IM client on my desktop did the same and even the Google Talk client is showing the same symptoms.

In addition, the problem appears to affect Gmail notifications on my phone (I’m having to manually refresh it to sync changes to my mailbox) and I can’t download anything from the Android Marketplace. In the last few hours the problem seems to have spread to Gmail itself and I can no longer log into Google Talk through my inbox either.

The problem appears to have coincided with the changes made by Google to reintegrate the gmail.com domain for UK-based users (due to a prior legal challenge many UK users had to make do with a googlemail.com address), which could simply be a coincidence, but either way it’s a massive PITA.

Some users have tried factory resets of their phones, removing and re-adding Google Apps features to their domains and even creating new Gmail accounts and re-associating their various services with them so as to make them accessible via their phones, though this isn’t recommended as it has some nasty side-effects such as making you re-buy any purchased Marketplace Apps.

The worst part of it all is that Google appear to be silent on the matter; there are a large number of threads on their support forums now covering most of the issues (with varying degrees of literacy and general coherence) but no official (or unofficial) word on what the cause of the problem might be and/or what the outlook is with regards to a fix.

Update – 12/05/2010: Well, after 5 days without Google Talk (and therefore without “push” email and the Android market), full service has been restored; to me at least. Let’s hope it doesn’t happen again any time soon.

On DRM And The Future of PC Games

Much has been made in the last couple of days of the fact that warez scene group Skidrow have “cracked” Ubisoft’s Assassin’s Creed 2, however, this isn’t really a crack of the DRM at all, it simply internalises the server emulation that non-scene groups had already put together so it’s not as much hassle to play.

That said, ultimately you can’t crack Ubisoft’s new DRM any more than you can “crack” World of Warcraft; they are serving parts of the game from their servers and unless you either obtain a copy of that data and emulate the server (which isn’t really a crack) you can’t get around it. It’s not as simple as just bypassing a CD check or setting a function to always return true, they’re actually shipping a partial game and as long as their customers will bear it (although given their awful server uptime they’re not helping themselves out) they’ll keep doing it and probably push it even further.

Once games move into the SAAS realm you can say goodbye to owning *any* part of a game you “buy” as all you’ll have is the MMO-esque client application and everything else will be delivered over the wire, doubtless with “Premium” subscriptions available if you want priority access to the game servers to minimize lag & waiting time before you can play.

I think we can all agree that this is a really bad place for PC games to be headed.

Get failed sshd logons from Windows Eventlog Part 2

In answer to my question about a more efficient means of filtering by timestamp with FilterXPath, I’ve worked out how to do it “properly”; it’s not as fast as I was hoping, but it’s still taken the execution time down from 20 to 2 minutes so I can’t complain too much. I’ve also modded the script to deal with cases where Password Authentication is disabled and so you don’t get “Failed Password” events logged, just “Invalid User” or “No supported authentication methods available” instead.

The time value for comparison is in milliseconds, so 604800000 for 7 days, 86400000 for 24 hours, etc.

#sshd failed logon attempt finder
#Adam Beardwood 12/02/2010
#v1.0 - Initial Release
#v1.1 - Dramatically improved event gathering speed and added handling for non-password authentication failures
 
#Get all SSH events from the last 7 days from the Application eventlog (this may take some time)
$events = Get-WinEvent -LogName Application -FilterXPath "*[System[Provider[@Name='sshd'] and TimeCreated[timediff(@SystemTime) <= 604800000]]]"
 
#Create array to store IPs
$ips = @()
 
foreach($event in $events){
	#Convert the event data to XML so we can access the EventData (Otherwise there's no way to access the event message contents with "unregistered" eventids)
	$event = [xml]$event.ToXml()
	#Thin the herd a little and only process useful messages
	if($event.Event.EventData.Data.Contains("Invalid user") -or $event.Event.EventData.Data.Contains("Failed Password") -or $event.Event.EventData.Data.Contains("No supported authentication methods available")){
 
	#Do regex search of the message data for IP addresses and if found, add them to the $ips array
	$ip = $event.Event.EventData.Data
	$regex = [regex]"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"
	$ip = $($($regex.matches($ip)).Captures).Value
	$ips = $ips + $ip
	}
}
 
$date = get-date -Format yyyy-MM-dd
$file = new-item -type file "SSHLog-$date.txt" -force
 
add-content $file $($ips | select -uniq)

Get with the program, Adobe

Almost 2 months after Adobe released a patch for Acrobat Reader 9.3.0 to resolve the highly critical remote execution vulnerability, they’re still offering 9.3.0 as the only option for download:


So unless you run the Adobe Updater immediately after install (Which seems to have issues with UAC on my Windows 7 machine unless you explicitly launch Reader as an Administrator), or make the effort to find the patch to 9.3.1, your machine is going to be at risk every time you open a PDF.

It’s not the first time they’ve done it, either.

Get failed sshd logons from Windows Eventlog

This script grabs IP addresses of the last 7 days worth (Customisable) of failed logon attempts for sshd from the Windows event log. This is handy if you use a Windows-based OpenSSH package like copSSH and want to be able to generate a list of all the people making random attempts to logon to your machine for adding to a blacklist or firewall rule.

#Get all SSH events from the last 7 days from the Application eventlog (this may take some time). Change "adddays(-7)" to alter the timeframe.
$events = Get-WinEvent -LogName Application -FilterXPath "*[System[Provider[@Name='sshd']]]" | ?{$_.timecreated -gt $((get-date).adddays(-7))}
 
#Create array to store IPs
$ips = @()
 
foreach($event in $events){
	#Convert the event data to XML so we can access the EventData (Otherwise there's no way to access the event message contents with "unregistered" eventids)
	$event = [xml]$event.ToXml()
	#Thin the herd a little and only process "Failed Password" messages
	if($event.Event.EventData.Data.Contains("Failed password")){
 
	#Do regex search of the message data for IP addresses and if found, add them to the $ips array
	$ip = $event.Event.EventData.Data
	$regex = [regex]"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"
	$ip = $($($regex.matches($ip)).Captures).Value
	$ips = $ips + $ip
	}
}
 
$date = get-date -Format yyyy-MM-dd
$file = new-item -type file "SSHLog-$date.txt" -force
 
#Add unique IPs to output file
add-content $file $($ips | select -uniq)

If anyone has a better way to filter Get-Eventlog using FilterXPath by date as well as something else (Provider in this case) rather than having to get the whole thing and “where” it after, please let me know. I know I *should* be able to do it, but I could never get it to work properly (I think it was a timestamp formatting issue) and the documentation is a bit spartan.

On IT and Friday Afternooons

It’s a curious feature of “Nine to Five” IT departments that Friday afternoons are always a write-off; not because of laziness or the typical end-of-week malaise, but because nobody is willing to risk making a change that could break something and leave them with Friday night overtime or even a full weekend of work.

As a result of this, a full 10% of the working week is wasted (well, 10% more than would be otherwise) playing flash games and messing around with remote controlled helicopters…for example. The problem is that there’s no easy solution, if you send everyone home on a Friday lunchtime, then it just means Friday morning is wasted – and the same obviously applies to having Friday off entirely or working Saturday mornings.

Clearly what’s needed is some kind of useful, read-only task that takes about 4 hours and can be done weekly without being too soul-destroying (I’m not spending every Friday afternoon writing documentation, that’s for sure). When I discover something I’ll let you know.