Category Archive: Tweaks & hacks

Script to Re-Map Windows Shares

I had some problems with the Windows Shares becoming unavailable at odd times, just randomly now and then. This meant I could no longer list and open my media files from my LG Home Theater or my Raspberry Pi.

I discovered that restarting a few services associated with Windows Folder Sharing solved the problem without the need to reboot.

This is a quick little script that I use to re-map my shared folders in Windows, including the disk shares (i.e. d$, e$) every night:

net stop LanmanServer /y
net start LanManServer
net start Browser
net start HomeGroupListener

Copy these lines in to a text-file using Notepad and save the file as “Sharemap.bat”, for example.

To set up an automatic scheduled job to run the script, open Task Scheduler (Start -> Run -> taskschd.msc) and set up a basic task: Right-click the folder area on the left and select “Create basic task”.

For the actions pane, select “Start a program” and point to the Sharemap.bat script.

For the triggers, you can set it to run every night at 5 in the morning or something similar.

If you’re using TrueCrypt and need to make disk shares (d$, e$ etc) map up after TrueCrypt mapping has taken place, create a trigger and set it to run “At log on”, with a delay that’s long enough to allow you to mount the TrueCrypt volumes before it runs (5-10 minutes maybe).

Alternatively, you can simply create a shortcut to “sharemap.bat” or save the file directly to your desktop and run it manually as needed.

How it works:
Stopping the LanmanServer service automatically stops the child services Browser and HomeGroupListener as well, automagically – so we only need to start those services, or at least I chose to do it that way to be on the safe side.

These network services are responsible for making Windows Shares available on the network, so it is sometimes necessary to restart them if there are any issues with finding shares, especially disk shares that are not automatically mapped by Windows, caused perhaps by delayed mounting from TrueCrypt or similar applications.

How To: Batch Converting FLV files to MKV

FLV to MKV batch conversion (article illustration picture)

To convert, or not convert? That is the question
And the answer is binary…

I wanted to convert some FLV files to a format that would play on my stand-alone LG Blu-Ray player via Home-Link and found a working solution worth sharing.

To convert one or more FLV (Adobe Flash Video Container) files to the more compatible MKV (Matroska) container “format”, simply follow the instructions below:

  1. You’ll need a copy of the FFmpeg executable:
    Download the latest Static 32-bit build from Zeranoe’s FFmpeg Builds page.
  2. You’ll now extract the compressed FFmpeg build you just downloaded.
    To extract the .7z file, I recommend using either 7-Zip (free!) or WinRAR (unlimited use shareware).
  3. Now copy the executable ffmpeg.exe from the bin folder that you just extracted to the same folder as your FLV files reside in.
  4. Open Notepad. (Shortcut: Windows key + R / Windows key + Q and type “notepad”. Hit enter.)
    1. Write or copy the following line into the empty notepad text editor box:
      for %%a in (“*.flv”) do ffmpeg -i %%a -vcodec copy -acodec copy %%~na.mkv
  1. Go to File and click “Save As…”
  2. Browse to the folder where your FLV files reside.
  3. In the file name box, enter (including the double quotes) a name for the file, with a .bat extension. For example:
    “FLVTOMKV.bat”.
  4. Hit Save.
  5. Browse to your newly created batch file and double click it to start the batch conversion process. It should only take up to a couple of minutes for a 300 MB file on a relatively new computer. You should see the progress clearly in the black command box that pops up.

NOTE #1: If nothing happens or you get an error message that you can’t read, try running the .bat file from the command line: Hit the Windows key + R / Windows key + Q . Type CMD. Hit ENTER. Type the full path to the batch file and hit ENTER again. You should now be able to read any error messages.

NOTE #2: You may need to rename the files to remove any spaces or special characters, or else the script can fail. I would suggest making copies of the original files, then you can simply copy and paste the old filenames back after conversion.

NOTE #3: Some FLV files may have MP4 extensions, and vice-versa. Either rename the extension to FLV if this is the case, or try changing the .bat command line to:
for %%a in (“*.mp4″) do ffmpeg -i %%a -vcodec copy -acodec copy %%~na.mkv

How-To: Upgrading the WiFi on the ASUS E45M1-I DELUXE

My media center has an excellent ASUS E45M1-I DELUXE motherboard, based on the dual-core AMD Fusion E-450 (aka “Zakate”) chip. This motherboard has a built-in AMD Radeon HD 6320 graphics chip which can render full HD content just fine.

ASUS E45M1-I DELUXE

ASUS E45M1-I DELUXE
Mini ITX Motherboard

The only problem is that the WiFi card that comes with the ASUS E45M1-I DELUXE motherboard lacks support for the 5GHz band.

The ASUS E45M1-I DELUXE is a Mini ITX  (6.7×6.7 inches / 17×17 cm) card, which I’ve stashed inside an old Silvestone Sugo SG05 case to make a decent media center PC for cheap. I’ve replaced the single 12cm case fan in the front with a silent Noctua fan and used an SSD instead of a regular harddisk, all in the name of silence.

Being the DELUXE edition, it comes with an onboard wireless card, which is connected by two wires to two antenna connectors sticking out at the back of the case (by the IO shield).

It all sounds great, but there’s a problem: the WiFi card that comes with the motherboard doesn’t support the 5GHz band on my wireless home router.

Read on to find out exactly why this is a problem and how I fixed it! Read the rest of this entry »

How To Turn Off The Prompt For Active Content When Opening Local Files In Internet Explorer

I just ran into this little issue when testing a small JavaScript, where Internet Explorer came up with this annoying little pop-up on the bottom of the page every time I wanted to test a new change in the code:

Internet Explorer restricted this webpage from running scripts or ActiveX controls | Allow blocked content

Unless I clicked “Allow blocked content” every single time, JavaScript was simply disabled.

That’s just no good… Read the rest of this entry »

How To Stretch Your Wallpaper Across Multiple Monitors in Windows

Even Mr Bolt-on knows

Even Mr Bolt-on knows this.

Everyone with some experience with Windows and more than one monitor connected, knows that Microsoft’s good old operating system just can’t handle multiple monitors very well.

Little has improved in Windows 7, and I was therefore faced with some odd challenges just trying to make a simple 3840×1080 pixels wide wallpaper fit properly.

The only built-in “wallpaper mode” that works with multiple monitor wallpapers is the “tile” mode. However, it didn’t work correctly on my setup, as it kind of started on the wrong display due to the internal “ranking” of my monitors, making the result look like so:

After a quick Google query or two, I happened upon the perfect tool to MacGyver this problem away: Read the rest of this entry »

Adding Custom Cities to the HTC Weather App

htcweather

In the summer time I like to follow the weather more than usual, so as to not miss a single day of fun in the sun, as we get it so rarely where I live by the arctic circle. However, my new HTC Touch Diamond 2 did not have my town in the weather application! So I set out to get my small town added in, and eventually succeeded thanks to the forum over at xda-developers.com. So, here’s my recipe which takes into account more possible issues than the forums do.

  1. Download and install ActiveSync, .NET Compact Framework 3.5 Redistributable and CeRegEditor.
  2. Browse your HTC phone using Explorer and copy the file “2330fc3c_manila” from the Windows directory onto your PC. Right-click this file and select properties. Untick the box that says “Read-only”.
  3. Download SQLite Administrator. This program does not require installation.
  4. Open the “2330fc3c_manila” file from step 2 using SQLite Administrator on your PC (make sure you select “Any files” when browsing for it).
  5. Select the “Edit Data” tab and click to select the “Cities” table in the tree on the left.
  6. Pick a city you won’t need and edit the “CityName“, “Country” and “accuweatherCode” to match the city you plan to add. You should also edit the timezone and msid values to match another city in the same country and timezone. To find your correct accuweatherCode and other values, look up your desired city on AccuWeather and see the last part of the URL string in your browser that looks something like this: “EUR|NO|NO007|VADSOE“.
    Tip: If your city name contains special characters you may need to substitute them. Check for a city with the same special character and copy from it. This also applies to the city name in the “accuweatherCode” field, except for that the replacement characters may be different. For instance, The “CityName” field may use “Ã,” to replace “ø” in the HTC interface, while the “accuweatherCode” field uses “OE” or “O” to replace the same character. In the address bar of your browser, these characters may be displayed similarly to “%F8%7C”, but do not let that confuse you.
  7. Close the editor. Right-click the now updated database file and select properties. Tick the box that says “Read-only”. Copy the new file back to your HTC, replacing the existing file.Tip: To accomplish this on my HTC Touch Diamond 2 I had to use TotalCommander for Pocket PC. Install TotalCommander by downloading the CAB file to your HTC and running it. Browse to the Windows directory and scroll down to the “2330fc3c_manila” file. Open the properties and remove the “Read-only” attribute. Copy the new “2330fc3c_manila” file from your computer to any folder on your HTC except the Windows folder. Then copy it in TotalCommander to the Windows folder, replacing the old file.
  8. Almost done! Using CeRegEditor, add the following registry key:
    [HKEY_CURRENT_USER\Software\HTC\Manila]
    “Weather.ServerURLOverride”=”http://weather.not2advanced.com/htcweather/forecastdata.php?ac=XDADevs&locCode=%25ls&version= 1&device=innovation”

    Tip: Do not include the “s. Add a new “String” with the name being the first part before “=” and value being the long URL.

  9. Shut down and start your HTC (aka soft reset) and it should now work when you add your new city (or cities)!
[HKEY_CURRENT_USER\Software\HTC\Manila]
"Weather.ServerURLOverride"="http://weather.not2advanced.com/htcweather/forecastdata.php?ac=XDADevs&locCode=%25ls&version= 1&device=innovation"

Older posts «