Tuesday, November 1, 2016

How to fix Sublime Text 3 "open with..." error

When trying to set explorer to open .txt files with Sublime Text 3, I couldn't select Sublime Text at all. After browsing for the sublime_text.exe, the list of programs still didn't show Sublime Text as an option.

It seems that Sublime Text 2 had left the registry in a broken state. The solution for this is to install CCleaner and running the registry cleanup, TWICE. After that, reinstall Sublime Text 3. Then right-click on a .txt file (or whatever file type you want to open with ST3) and select Open with... - Choose default program... - Browse... and find sublime_text.exe. Now you can select Sublime Text.

Sunday, October 9, 2016

The Fall crash solved

The Fall is the best adventure game I've played for years. It's a very innovative scifi-themed game with a really dark plot and great atmosphere.

But I was having a big problem: the game crashes every time after a certain scene where the main character is being hacked into. You are supposed to press the ESC key at that point, but pressing it causes a crash and a return to desktop.

This happens at least with my setup, Windows 7 32-bit, and the Steam version of the game.

Fortunately, there is a solution:

1) right-click on The Fall in your Steam library and select Properties

2) press on the "Set launch options..." button

3) Type in this text: -force-d3d9

After that I had no problems at all.

The reason for the crash seems to be in the new DirectX version. The above launch option forces the game to use the older DirectX 9.

Have fun with one of the best adventure games around!

Wednesday, August 24, 2016

How to fix Thunderbird search

Thunderbird search index gets corrupt from time to time, and here's a short guide how to make it work again.

I was able to search for things and got some results, but I was unable to open them when clicking on the results. Instead, Thunderbird opened an empty window.

How to fix it in Windows 7 and Vista:

1. Close Thunderbird

2. Open Windows Explorer and go to C:\Users\YOUR_USERNAME\AppData\Roaming\Thunderbird\Profiles\SOMETHING.default, where YOUR_USERNAME is your windows username and SOMETHING is the random profile ID that Thunderbird has created for you.

3. Delete the file global-messages-db.sqlite

4. Start Thunderbird and go to Tools -> Activity Manager. You can see Thunderbird rebuilding the search index. This can take a very long time!

Now you can enjoy the working search, as least as long as it lasts!

If you use another OS, the global-messages-db.sqlite might be in a different location. Here's a guide how to locate your Thunderbird profile folder.

Monday, July 11, 2016

Using windows shell script and adb to backup stuff from your Android phone

Here's some tips on how to write a shell script to backup stuff from your Android phone to a Windows machine. This should work on any version of Windows, but I've only tested it on Windows 7.

First, you need the Android SDK installed. The command line tools are enough, you don't need the full Android Studio. You will be using the adb.exe found within to do the transfers and removing of files on the phone.

Second, you need an ADB (Android Debug Bridge) driver for your phone installed. Most phone manufacturers provide ADB drivers on their websites. Third, your Android phone needs to be in developer access mode.

You should do a couple modifications to the script below. These include setting the ADB path variable and setting the destination folders for sound recordings and images.

You can also uncomment a couple lines to make the script delete files from your phone. But note that this is quite dangerous, since if the adb transfer fails for some reason, you might end up just deleting your files without transfering them. The script should pause after a transfer error (at the if %errorlevel% lines) and will continue if you press enter. So be careful if you decide to uncomment those lines!

Below is the example script. Simply paste it into notepad, edit the parts as described in the comments and save it as a .bat file, for example backupscript.bat. Have fun backing stuff up!

@ECHO off

:: SET THIS VARIABLE TO POINT TO THE ADB.EXE
set adbpath="C:\Development\Android SDK\platform-tools\adb"
echo ADB path is %adbpath%

:: SCRIPT FOR GETTING DATE STRING IN FORM YYYY-MM-DD
:: Source: stackoverflow.com
:: Works on any NT/2k machine independent of regional date settings
:: 20110103 - adapted by jeroen@pluimers.com for Dutch locale
set v_day=
set v_month=
set v_year=
SETLOCAL ENABLEEXTENSIONS
if "%date%A" LSS "A" (set toks=1-3) else (set toks=2-4)
  for /f "tokens=2-4 delims=(-)" %%a in ('echo:^|date') do (
    if "%%a" GEQ "A" (
      for /f "tokens=%toks% delims=.-/ " %%i in ('date/t') do (
        set '%%a'=%%i
        set '%%b'=%%j
        set 'yy'=%%k
      )
    )
  )
if %'yy'% LSS 100 set 'yy'=20%'yy'%
  set Today=%'yy'%-%'mm'%-%'dd'%
ENDLOCAL & SET v_year=%'yy'%& SET v_month=%'mm'%& SET v_day=%'dd'%

set datestring=%V_Year%-%V_Month%-%V_Day%
echo Date-time string is %datestring%

:: TRANSFERS BEGIN

:: RECORDINGS FROM SOUND RECORDER

:: CREATE THE DESTINATION FOLDER...
:: Change this to whatever folder you want the files transfered to
set dest=C:\MyRecordings\%datestring%
echo Creating folder %dest%
mkdir %dest%

set source=/storage/sdcard1/Recording/

echo Copying from sdcard path %source% to %dest%
%adbpath% pull "%source%" %dest%
if %errorlevel% neq 0 pause

:: Uncomment these lines to delete files from your phone after transfer.
::echo Deleting all from sdcard path %source%
::%adbpath% shell rm '%source%'*

:: CAMERA IMAGES

:: CREATE THE DESTINATION FOLDER...
:: Change this to whatever folder you want the files transfered to
set dest=c:\MyPictures\%datestring%
echo Creating folder %dest%
mkdir %dest%

set source=/storage/sdcard1/DCIM/Camera/

echo Copying from sdcard path %source% to %dest%
%adbpath% pull "%source%" %dest%
if %errorlevel% neq 0 pause

:: Uncomment these lines to delete files from your phone after transfer.
::echo Deleting all from sdcard path %source%
::%adbpath% shell rm '%source%'*

:: WHATSAPP SENT IMAGES

:: We use the same destination folder as in the previous step.
set source=/sdcard/Whatsapp/Media/WhatsApp Images/Sent/

echo Copying from sdcard path %source% to %dest%
%adbpath% pull "%source%" %dest%
if %errorlevel% neq 0 pause

:: Uncomment these lines to delete files from your phone after transfer.
::echo Deleting all from sdcard path %source%
::%adbpath% shell rm '%source%'*


:: WHATSAPP RECEIVED IMAGES

:: We use the same destination folder as in the previous steps.
set source=/sdcard/Whatsapp/Media/WhatsApp Images/

echo Copying from sdcard path %source% to %dest%
%adbpath% pull "%source%" %dest%
if %errorlevel% neq 0 pause

:: Uncomment these lines to delete files from your phone after transfer.
::echo Deleting all from sdcard path %source%
::%adbpath% shell rm '%source%'*

:: PRESS ANY KEY TO CONTINUE
pause