2011
02.10

On one of my backup servers I needed to monitor and sound an alarm by email if file modification times were not updated for X days. This means the backup job updating the file has stopped and needs to be manually checked.

Download the .exe – file below and run it with /checkfiles as a scheduled task after your backup jobs are complete.

Download tstampmon.exe (~1.5MB)

Should run on most Windows versions.

2010
11.21

Vad är detta?

Det här är lite av en sjukdagbok, mest för att jag skall kunna hålla kolla på vad jag testat/undersökts för osv, det blir lätt en enda gröt efter ett tag. Jag har ingen som helst medicinsk utbildning utan lägger upp det publikt på nätet mest för att någon annan kanske kan ha nytta av vad jag kommer fram till och det jag provar.

Bakgrund

Lite bakgrund om mig själv först: 30-årig man som regelbundet tränar både kondition och styrka 4-5 ggr/vecka, generellt frisk utan några större fel förutom en hormonrubbning i sköldkörteln (Graves sjukdom) som jag dock hade koll på och var medicinerad för. Vegetarian med bra koll på näringslära, äter och lever rätt så nyttigt utan att för den sakens skull vara något hälsofreak.

Symptom

Yr på ett sätt som närmast kan beskrivas som berusad. Blir marginellt bättre ju längre tiden går men kan samtidigt bli avsevärt sämre om jag tröttar ut mig, blir förkyld eller liknande. Har aldrig tappat balansen eller liknande. Känner mig bortkopplad från verkligheten, en mycket surrealistisk känsla som om man upplever världen genom ett filter eller är under vatten. Eller om man är väldigt förkyld och igensatt överallt. När det är som bäst känner jag bara av det när jag anstränger mig, som sämst är det som att befinna sig i en snökula som skakas om.

  • Ont/öm i nacken. Knakar/smäller, väldigt spända/ömma muskler i nacke och axlar.
  • Ögonen känns tidvis ansträngda och ”stela”.
  • Hettande känsla i delar av ansiktet.
  • Lock för båda öronen och tjut som varierar i styrka, tryckkänsla.
  • Tidvis åksjuk. Var vanligare de första månaderna men kan fortfarande skölja över mig ibland.
  • Extremt ljudkänslig. Kraftiga ljud speciellt på morgonen är närmast outhärdliga.
  • Ljuskänslig.
  • Väldigt låg motståndskraft. Anstränger man sig lite för mycket tilltar yrseln direkt, och jag kan bli vansinnigt trött när yrseln tilltar (sömnig).
  • Tidvis känsla av “nervryckningar” i ansiktet, runt ögonen, upp över hjässan. Kan även kännas som om man hade myror under huden.

Vanligtvis är alla symptom kraftigare på morgonen och avtar under dagen, men även detta mönster kan variera. Alla symptom varierar i styrka och det enda som hittills varit konstant 24 timmar om dagen är yrseln samt nack/ryggbesvären. Av dessa symptom är det endast nackbesvären som jag haft innan startepisoden (se nedan).

2009-12-2X

Hela äventyret började för mig strax efter julen 2009. Jag kände en dag att en nackspärr var på gång, och när det var dags att gå att lägga sig på kvällen hade jag rejält ont. Under natten utvecklade det hela sig till något av det värsta jag varit med om, så det blev inte många minuters sömn. Kraftig huvudvärk. Vimmelkantig av smärta och sömnbrist hasar jag mig upp på morgonen, men sätter mig efter en stund vid köksbordet för att hämta andan. Jag känner hur jag blir övermänskligt trött och hur hela världen snurrar, så jag vilar huvudet på armarna på bordet. Nästa sak jag minns är hur min sambo hysteriskt pratar med någon i telefon gällande en ambulans. Det visar sig att jag förlorat medvetandet och ramlat ner på golvet. Det tar mig ett par minuter att få luft i lungorna igen då jag tydligen slutat andas, och efter att ha hostat lite blod en stund kvicknar jag så sakta till.

Det närmaste dygnet händer rätt mycket saker och det är svårt att härröra ett symptom eller en känsla till det ena eller andra, det var omtumlande nog att åka ambulans osv. när man aldrig gjort detta tidigare. Klart är dock att jag fått röda prickar i hela ansiktet, nästan som nässelutslag. Troligtvis från ansträngningen när kroppen startade om. Jag har även rätt irriterande “nervryckningar” i ansiktet och pannan. Känner mig svag, skakig och vinglig men tänder inte så mycket på det under omständigheterna. På sjukhuset tas hinkvis med blodprover (B12, borrelia, mm), EKG, syresättning, reflexer, neurologiska tester osv osv. Allt ser perfekt ut och en dag senare åker jag odiagnostiserad hem igen och det hela avskrivs som en engångshändelse.

2010-01-0X

Jag återhämtar mig något de följande dagarna men känner mig fortfarande orkeslös och vimmelkantig. 5 dagar efter den första episoden åker jag åter in till akuten igen då yrseln blir ohanterlig. Samma prover tas igen, med samma resultat (all good). Får diagnosen inflammation på balansnerven av en stressad akutläkare. Detta skall gå över med tiden av sig självt, och han bokar även in en tid för EEG pg.a. att jag “svimmade” tidigare och han vill kolla att jag inte är epileptisk (gör senare provet, inga problem med detta). Blir hemskickad.

2010-03-10

Besöker en balansspecialist på en vårdcentral i Mölndal. Efter att mätt ögonrörelser och gjort diverse tester konstateras att jag har fantastiskt bra balans. Där faller med andra ord teorin om balansnerven och hans personliga teori är att balanscentra i hjärnan är överbelastat och behöver tränas upp för att tolka signaler från balansorganen rätt.

2010-03-25

Besöker distriktsläkare på min VC och tar ytterligare blodprover i hopp om att finna något men allt är OK. Får remiss till magnetröntgen.

2010-04-22

MR av hjärna, halsryggrad. Allt ser bra ut.

Sommar 2010

Skaffar nya glasögon för att utesluta synpåverkan. Drar visdomstand som sitter lite galet för att utesluta spänningar från käken. Provar lite olika kiropraktorer/osteopater för nackbesvären. Tillfällig förbättring av nacken men det återgår tämligen snart till samma läge.

2010-09-25

Besöker Öron-näsa-halsläkare på Sahlgrenska. Hörseltest: Bra hörsel. Undersöker öron utan att se något fel. Teori om att spänningar i nacken fått örontrumpeten att låsa sig i öppet läge. Remiss till sjukgymnast med specialitet nackar.

2010-10-18

Skaffar en bettskena för att utesluta spänningar under sömn. Ingen större skillnad men skall prova några månader.

2010-11-15

Besöker distriktsläkare på VC igen. Ber om remiss till en neurolog. Dessutom tas en uppsättning nya blodprover.

2010-11-19

Alla prover från 15:e helt OK. Besöker sjukgymnast/rehab. Behandlas med ström genom axlar/nacke, värme, massage. Känns något bättre direkt efter men försämras igen efter några timmar. Får “cirkulationsövningar” att utföra.

2010-12-17

Gjort cirkulationsövningar minst 1ggn/dag, gått hos sjukgymnasten 2ggr/vecka under en månad. Tens -behandling (elektrifiering ;)), värme. Känns som om detta slappnar av axelpartiet tillfälligt i alla fall. Inte märkt någon större skillnad i övrigt (yrsel osv). Inväntar tid för besök hos neurolog.

2011-01-11

Besökt neurolog som bedyrar normal neurologisk status och instämde i teorier om att problemen kommer från nacken. Skall prova på en omgång akupunktur nästa vecka.

2011-02-16

Testat akupunktur under några veckor. Försiktigt positiv även om jag personligen inte riktigt tror på behandlingsformen. Det känns dock som om lockkänslan/trycket i skallen släpper något efter en behandling.

2011-03-15

Lagt ner akupunkturen. Fått rekommendationer om en fysioterapeut som skall prova under en tid för o se om det kan ge något.

2011-12-16

Gått på behandlingar hos fysioterapeut ca. varannan vecka nu under de senaste nio månaderna. Börjar bli mer och mer övertygad om att mina besvär hänger ihop med den tryck/lockkänslan jag upplever och det i sin tur med nacke/axlar. Det känns som om yrseln blivit något lite bättre, alternativt har jag helt enkelt blivit bättre på att ignorera det hela. Upplevde dock en period i slutet av sommaren då trycket i skallen släppte något, jag hade mindre ont i nacken och yrseln blev markant bättre. Det höll i några veckor innan jag blev sämre igen, men inger ju ändå ett visst hopp. Tålamod…

2014-06-06

En liten uppdatering kanske är på sin plats, jösses vad tiden går…

Jag skall inte säga att jag är helt återställd, men det har blivit så pass bra nu att jag kan leva mitt liv obehindrat. Jag har fortfarande dåliga dagar, men är nu helt övertygad om kopplingen mellan nacke/axlar och yrseln. I takt med att det blir bättre blir också yrseln lindrigare, men det verkar vara en långsam process. Lock för öronen och tryckkänslan i skallen har även det blivit mycket bättre, men vet inte vilket som är hönan och vilket som är ägget. Går fortsatt hos fysioterapeut ca. varannan vecka och tror att det i kombination med att aktivt fokusera på att slappna av i kroppen har gett resultat. Följer ingen speciellt lära runt det, men kan väl liknas lite vid mindfulness kanske. Försöker meditera lite en stund varje kväll också, vilket – om ingenting annat – i alla fall gör att man slappnar av för stunden. Stress är fortsatt destruktivt för mitt tillstånd, och även om det är omöjligt att inte stressa i mitt yrke/liv så får man i alla fall vara medveten om det och försöka så gott man kan.

Kraniosakral osteopati som diskuterats i kommentarerna nedan är faktiskt någonting jag planerar att prova, det verkar ju om inte annat vara riktat mot rätt problemområde. Återkommer med resultat av detta när jag fått tummen ur.

2010
11.20

Practical Programming

(You’re doing it wrong)

Before we get on with the business of me pissing you off, let’s first get some background data. I work as a consultant. There, I’ve said it – get the prostitute jokes out of your system. Now, for some people working in a bubble never having to worry about interacting with other programmers code, the following conclusions might seem completely wrong. If so, congratulations – you are one of the lucky few with total control over you development environment. You have to take what I say into the following context; every month I work on code originally written by about 20 different people, then modified by another ten. Besides code written by me from scratch, of course. I work in my own environments but also in client provided ones, using a variety of tools more or less of my own choosing. An average month I probably write code in four or five different languages, and about as many dialects. It’s a mess, but it has also given me a quite unique insight in other peoples work structures.

I wrote my first piece of code when I was 10 years old. It was very basic in every sense of the word, since it was on my very first computer, a C64. I then carried on writing stuff for my own needs for a few years, until I finished school (barely) and started supporting myself by coding full time. This was well over 10 years ago now. Even so, I do not consider myself a true “programmer”, and this is why: My Ego is not big enough.

There are two main types of programmers (and right away I’ll make some mortal enemies disregarding the HTML-kiddies entirely, but I’m sorry – you do not even qualify): Practical programmers and Egocentric programmers (P-Coders & E-Coders). The E-Coder like to read book after book in The Tao of Programming (yeah, the irony was intended), tend to jump on the latest hype full throttle and write code so beautiful it should be framed and put in a museum. Furthermore, often times they are Programmers first and foremost, not often involved in other areas of business like IT management and alike.

The P-Coder on the other hand often have a more diverse knowledge base, has no problems configuring networks and managing servers (I’m not saying a E-Coder can’t do these things, but in my experience if they do, it’s not for the sake of learning or having fun but more of a necessary evil). P-Coders write code for the sake of obtaining a result or solving a problem as opposed to the E-Coders, that write code because this is what they love doing more than anything else. For the P-Coder the process of solving the issue at hand is often more rewarding than the end result, in terms of finished code.

In terms of plain writing code there is little question that the E-Coders are the best at the Programming itself, as a method – or even a philosopy, if you will. This however has little meaning in “the real world” where results, efficiency and money comes in to play. This is why.

Your Ego is killing all the bunnies

Having belief in oneself is a good thing. It makes you better at your job and even socially more capable. This, however, should not at any time be confused with thinking you are God. Self distance and is also a good thing, and even better is the possibility for self criticism, when required. Here are some examples to why it is good to keep your Ego on a leash when programming.

  • Beautiful code in many opinions is the code that is the most effective in the least amount of rows. Effective code is often very complex. Complex code makes other people debugging your code hate you. Too Complex code makes your boss angry for burning company time and money.
  • OOP has it’s uses, but for the sake of all things holy – use restraint. I’d never argue that for things like DB access, user handling or similar OOP is – quite frankly, the shit. However, when you have one single call in main and then the rest of your program mysteriously executes down the dark trails of 100’s of classes and sub classes, it’s safe to say you’ve gone overboard.
  • Frameworks also have their uses, but use your head – if you’re writing an app that makes coffee, don’t include a framework that can also grow and harvest the bean. Some might say this is to future-proof, I say it’s lazy. If you do use frameworks, include it with your source. When someone tells you future versions of their framework will be backwards compatible, they’re lying. In the world of components, this is even more true and has even worse impacts. Repent!
  • In reference to the two previous in combination with Web development, MVC Framworks are generally to be considered the spawns of Satan. Yes – if you’re building something gigantic it might be of use. The security ideas are correct. The rest is an endless soup of overhead designed to suck the life out of any programmer picking up where you left off. Let’s face it, Web development is normally not something that gets so advanced that it warrants enmeshing your company or your client to this degree.
  • When faced with a problem your Ego will slow you down in finding the solution. For example, E-Coders tend to take variables in the environment for granted on a larger scale than P-Coders. Start to look at a problem from an angle assuming “I can’t be wrong” and you will spend more time compared to keeping an open mind. The same goes for in-data related bugs. E-Coders tend to check for in-data errors at a later stage than P-Coders, who usually start out a debug session with verifying what is in the database or checking input parameters.
  • Parading around the latest Buzz might make you sound cool, but adopting each and every one at an early stage is extremely counter-productive. After some time has passed since the launch of  a new technology or methodology early adopters share their experiences, and every time there was this or that aspect that no one had seen coming. Keep your pants on and evaluate from a practical point of view so that you don’t look like a fool later. SOAP anyone?
  • Keep it together. For someone stepping in debugging your code, understanding it is like reading  a book. A book or any other readable text (except maybe mine) has a certain flow. Any time you move a piece of logic out of the flow it gets harder to read, especially for someone not fully initiated in all the ifs and buts of a project. In a proper debugger environment you can always step into functions, but it still adds a certain amount of stress for every one call. If you don’t need it, don’t use functions or classes just because you can. Code that you know only will be executed once belongs in the main flow. For the same reasons, avoid stored procedures unless they are really needed, like say for speed reasons. I know this will sting for some puritans and there are some other practical bonuses that will be lost as well, but it is such a serious breach of flow moving logic to the database it’s seldom worth it in the long run. Also, some IDE’s provide internal debugging for SP’s, but far from all – and if yours don’t even the more reason to use restraint.
  • Regular Expressions. Oh boy… First of, moving between languages and all the different dialects of RegEx is hell. It just is. Like all technologies, it has it’s uses; simple string matching, scripting binaries and things like that. Do not shift logic from your programming language into the RegEx parser. A programmer looking at a previously unseen complex RegEx will spend that much more time deciphering it, that there is simply no excuse for doing it – no matter how awesome it makes you feel writing that beautiful expression.

Some things I really would like to tell all E-Coders:

  • Never rewrite an old piece of code just because you know how to do it better. This will produce new bugs.
  • The old expression “assumption is the mother of all fuckups” still applies. Never assume that a previous programmer didn’t know what they were doing when something looks strange. Never assume your new shiny code will produce the same end result in all situations when rewriting something as vital as say, a global function.
  • Never fix bugs you happen to stumble across unless really serious. Report them to someone that has an idea of the bigger picture. A bug might have triggered a user behavior or setup pattern that you are unaware of and your fix might make things worse.
  • Never commit untested code. There is no excuse for not compiling before a commit no matter how small a change has been. If you’ve changed something that affects an SQL-statement, make sure to run through it before submitting the code.
  • The cold was is over. With it, the need to save every single byte on a source level. Format your code. Indent, space out your expressions, operators, etc. Name your variables and functions so that everyone understands. E-Coders often spend a day writing the most beautiful class, only to assign results from it to variables named x, y and z. Try to be consistent and don’t forget this also applies to your queries.
2010
05.06

When having to implement static binaries on web sites (like images, flash etc) sometimes browser caching can be a real headache. Particularly the Flash player doesn’t seem to care too much about headers and no-cache metas, so when I had a .swf that simply refused to reload a while back I came up with the below workaround. It utilizes the fact that PHP is somewhat binary safe, and pads the binary with NULL characters of random amounts in order to force reloads. The method is not in any way limited to this use but can be applied to any situation when caching of binaries is a big no-no.

For those of you who doesn’t really understand the code, here’s how to use it:

  1. Create a PHP file in the same directory as your binary swf-file. Give it the same name, only with the .php extension (ie. for movie.swf name the file movie.php).
  2. Paste the contents of the code-box below into the file.
  3. Call the PHP file from withing your HTML instead of the Flash file, ie. <embed src=”movie.php”….

<?
$max_increase = 50; //how much to allow file size to grow, in kB

$increase = rand(1, ($max_increase * 1024) / 64) * 64; //we’ll stick to 64 byte chunks
$file = basename($_SERVER[“SCRIPT_NAME”], “.php”) . “.swf”; //change if not .swf
$new_size = filesize($file) + $increase;
$data = file_get_contents($file);

header(“Expires: Sat, 26 Jul 1997 05:00:00 GMT”);
header(“Last-Modified: ” . gmdate(“D, d M Y H:i:s”) . ” GMT”);
header(“Cache-Control: no-cache, must-revalidate”);
header(“Pragma: no-cache”);

header(“Content-type: ” . mime_content_type($file));
header(“Content-Length: ” . $new_size);
header(“Content-Transfer-Encoding: binary”);

$data.= str_repeat(chr(0), $increase);

echo $data;
?>

2010
04.11

This is an old post from one of my old sites, but since people still seem to have this issue I decided to re-post it here. Below are some solutions problems you might experience with USB devices in Windows XP, especially so when the computers resumes from S1/S3 standby or hibernation. However, these tricks can be applied to most any USB device giving you grief and in need of resetting. A reset of a device is very tricky to automate, so these steps aren’t pretty. At all. Never the less, if you’re reading this you probably don’t care, right? OK, so let’s get down to it.

PLEASE READ
In many cases, the problem is exactly what Windows is telling you. If you get an error about a device exceeding it’s power limits, that might be precisely what is happening.
Power hungry devices like external hard drives, coffee warmers, vibrators and alike require more power than what an USB port can supply. In these cases, none of the below will help. What you need then is a product like a powered USB Hub to help power the device.
A hub will probably solve the problem for 90% of you. If you know this isn’t the case, read on.

PLEASE READ #2:
Off course I won’t take responsibility for something you mess up. So if you are thinking of suing me because you wiped out your hard drive attempting the below, tough luck. Won’t happen.

Step 1: Getting XP to shut up about device problems. In my case, I got this in my face every time resuming the computer from standby: A USB device has exceeded the power limits of its hub port. For assistance in solving this problem, click this message. Annoying, since it in my case is total bullshit. To get rid of messages like this (and we really really want to don’t we?) open the device manager (start menu -> run -> devmgmt.msc). Now, expand the USB group at the bottom of the list and double-click any “Universal Host Controller”. Click the “Advanced”-tab, and check the “Don’t tell me about USB problems” option at the bottom. Click OK and close the device manager.

Now, this might be enough for some of you. If you’re not using the port windows is nagging about then go to the fridge and grab a beer because this is all you have to do in order to shut it up. However, the port/device will still be disabled. If you do need the port/device and still feel eternally damned, read on.

Step 2: Reset USB device/port. This is the tricky and really really ugly part, so lock up you children and pet your dog before proceeding. For this we need a little application called devcon from MS. Grab it and put it in C:\Windows (or any other place, but we’ll use this in our examples below). Then, open the device manager (start menu -> run -> devmgmt.msc).
What we need to do now is find out which hub (port) our troubled device is connected to. To do this, expand the USB group at the bottom of the list. In sequence, open every “USB Root Hub” and click the “Power”-tab to see if your device is listed there.

When you have found the hub that has your device listed, click the “Details”-tab. Write down the name shown in the list between the first and second \-sign, for example “ROOT_HUB20”, on a piece of paper.

In the example above it’s the “USB Mass Storage Device” that keeps shutting down, and by doing the above we found out it’s connected to ROOT_HUB20.
Next, start a Command Prompt (start menu -> run -> cmd). Type in the following, replacing ROOT_HUB20 with what you wrote down on your paper.

C:\>devcon remove *ROOT_HUB20*
USB\ROOT_HUB20\4&32FF5014&0 : Removed
1 device(s) removed.

C:\>devcon rescan
Scanning for new hardware.
Scanning completed.

Now windows should remove and re-detect the hub and any eventual devices attached to it, re-enabling them in the process. If not, you probably got the wrong hub. Redo the above steps until it works.

Great, now we’ve managed to reset the device. Let’s do a batch file outta this so we don’t have to poke around manually every time we need a reset. Open notepad (start menu -> run -> notepad) and put in the following (replace ROOT_HUB20 as above):

@ECHO OFF
C:\WINDOWS\devcon remove *ROOT_HUB20*
C:\WINDOWS\devcon rescan

Go to the “File”-menu, choose “Save”. In the “File name”-field, enter “C:\WINDOWS\usbreset.bat” (yes, without the “‘s) and click “Save”.
If you’re not experiencing your problems particularly when windows resumes from standby, this is probably the end of the line. Just put a shortcut to the batch file on your desktop or do start menu -> run -> usbreset whenever you want to reset the device. However, if you are having the problems on resume and still feel somewhat damned, read on.

Step 3: Automating it. We’re getting closer. Can you feel it? We need some more stuff for this next step, namely a sleep command and Nate DeSimone’s neat Hibernate Trigger. Put sleep.exe in C:\Windows to start with. We now need to edit our batch-file again as below (start menu -> run -> notepad C:\WINDOWS\usbreset.bat):

@ECHO OFF
C:\WINDOWS\sleep 5
C:\WINDOWS\devcon remove *ROOT_HUB20*
C:\WINDOWS\sleep 2
C:\WINDOWS\devcon rescan

The sleep’s are there to cut the hardware some slack when waking up all dazed and confused. I wouldn’t mind something like that myself in the morning. Anyways, save the batch-file (CTRL-S) and then install Hibernate Trigger we just downloaded. During install, choose to have it start with windows.

After completing install, start the program from your start-menu. On the second line (wakeup command) input “C:\WINDOWS\usbreset.bat” (yes, without the “‘s). Check the minimize box and then minimize the application. This should be it! Try sedating the machine, wake it, get upset when it isn’t working, fiddle around some more and then finally go get yourself a beer when you got it working.

Visitor contributed thoughts:

MB: Very much the same with not extra sw. make the following file (change Dev ID)

C:\sleep.bat

———————————

RUNDLL32.EXE PowrProf.Dll,SetSuspendState
devcon remove USB\\VID_0424*
devcon rescan

———————————-

Then setup a schudled task when the system has been idle x amount of time (hibernate needs to be switched off).

Edwin: Was only not so charmed about the Hibernate Trigger progam, but used the Vista native Task Scheduler instead:

Create Task -> Triggers -> New -> On an event -> Log: System -> Source: Power-Troubleshooter -> Event ID: 1

Also tick “Run with highest privileges” at the General tab.

And next select your batchfile at the actions tab.

Evaldas Jocys: You don’t need sleep.exe to add delays, use ping command instead.
You can reset multiple devices by calling :ResetUsb function with parameter (%1).
—————————————-

@ECHO OFF
:: What we need to do now is find out which hub (port) our troubled device is connected to.
:: 1. Open the device manager (start menu -> run -> devmgmt.msc).
:: 2. Expand the \”Universal Serial Bus controllers\” at the bottom of the list.
:: 3. In sequence, open every \”USB Root Hub\” and click the [Power] tab to see if your device is listed there.
:: 4. When you have found the hub that has your device listed, click the [Details] tab.
:: 5. Write down the name shown in the list between the first and second \\-sign, for example “ROOT_HUB20”
:: 6. Add CALL :ResetUsb *ROOT_HUB20* here … (you can add as many lines as you want…)
::CALL :ResetUsb *ROOT_HUB20*
CALL :ResetUsb *ROOT_HUB20*
GOTO:EOF

:ResetUsb
:: Delay for 5 seconds.
ping 1.0.0.0 -n 1 -w 5000 > nul
devcon remove %1
:: Delay for 2 seconds.
ping 1.0.0.0 -n 1 -w 2000 > nul
devcon rescan
GOTO:EOF

2010
04.09

If you’re like me and keeping track of your movie collection by IMDB ID’s this is a painless way of importing them into the excellent “My Movies” plugin for Media Center.

  1. Create a working directory on your machine.
  2. Create a text file, call it “file.txt” and add your IMDB ID’s one per line, preserving the “tt”-prefix, ie. “tt0076729”.
  3. Create another text file, name it whatever you like and add the following two lines:

    for /f “tokens=*” %%i in (file.txt) do @echo off> %%i.mkv
    for %%a in (*) do (md “%%~Na” && move “%%a” “%%~Na”)

  4. Rename the text file you just created and change the extension to .bat. Run it. This step will create a bunch of directories with the IMDB ID’s.
  5. Start the “Collection Manager” included with “My Movies”.
  6. File menu->Import->Folder content. Point it to your working folder and sit back while it builds your database.
2010
04.09

I previously had a PCTel HSP56 PCI modem in my Tapirex server for monitoring Caller ID, but moving the machine to a VMWare client made me look for alternatives after testing the modem with VMDirectPath and realizing it didn’t work with that modem (BTW, here are my Patched PCTel drivers that will enable CID if anyone needs it).

Now, after reading some forums it seemed the Zoom modem would work so I went ahead and ordered it from Expansys. I then attached it to my Silex USB-over-ethernet hub and mounted it on the Windows 7 client (all though the fact that it’s attached to a VMWare client in this way doesn’t really make any difference, it would be just the same scenario when plugged directly into a physical machine).

So, first off; enable CID on the Zoom. This is done by using a terminal program and sending the “at+vcid=1” command followed by “at&w” to save it to the modem firmware. Alternatively, it would probably suffice to add “at+vcid=1” to the “Extra initialization commands” of the modem (Device Manager->Modem->Advanced).

Now, this should be all but I still couldn’t get it to work. Since I’m using a VoIP box to push internet telephony into my existing phone lines, I do however have the possibility to fiddle around with the CID sequence that is presented to the modem a bit more than your average Joe. And behold, turns out the Zoom modem does not pick up on DTMF signals at all (this CID standard is used here in Sweden and other places as well). When it was changed to Bellcore (US, china, etc) the modem immediately picked up on the signal. Luckily for me I could change this in my PAP2 VoIP box, and it also turned out that my other CID enabled devices on the phone line could handle Bellcore. If you are not in the position where you can change this (ie. on a normal land line) and in a country that uses anything but Bellcore I guess you’re out of luck until Zoom fixes this in their drivers or firmware.

Here are the device settings for the Zoom modem in Tapirex:

2010
04.09

I recently bought a Silex Sx-3000GB (or “SILEX USB 2.0 SERVER FOR NETWORK” as my store called it) for use with two WD MyBook drives and some other stuff on a Windows 7 guest OS. The initial setup went fine, even though it installs a tray app for the logged in user (didn’t bother me at the time since I always have a user logged on anyway). However, I soon started seeing some strange behavior as the disks were constantly connecting and disconnecting/reconnecting. The solutions turned out to be installing the software as a service. Here we go:

  1. You need instsrv.exe and Srvany.exe, these are part of the “Windows 2003 Resource Kit” (http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en) and installs on W7 as well. Put them in %WINDIR%\system32.
  2. Open cmd. Execute “instsrv SXVirtualLinkStarter %WINDIR%\system32\srvany.exe”.
  3. Start regedit and go to “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SXVirtualLinkStarter”.
  4. Create a new key and call it “Parameters”.
  5. In Parameters, create two new Strings. “AppDirectory” with data “C:\Program Files\silex technology\SX-Virtual Link” and “Application” with data “C:\Program Files\silex technology\SX-Virtual Link\connect.exe”. Adjust the paths accordingly.
  6. You now have a new Service, make sure it runs as the same user as the one used to access the hardware and set it to start automatically if desired. Keep in mind you cannot use the Silex software UI as long as the service is running, so if you need to change any settings; stop the service, start the app as normal and save your settings, close the app and restart the service.

I’ve had it setup this way and running smoothly for a few weeks now. Even though the Silex device is not very fast (I average about 8MB/s both read and write) the disks feel fairly snappy and seems to produce OK access times. This guide should also work on other Server based OS’s (2003/2008). If the connect/disconnect issue is related to the OS running on VMWare I do not know, however this can be done on any “normal” Windows install as well. It should also work for other Silex devices using the same “SX-Virtual Link” software.

On a final note, I learned that older Silex devices are compatible with the Belkin USB servers and that the Belkin software could be used instead. The Belkin software is said not to have the disconnect problems but it did not work with the SX-3000GB.