Monday, August 19, 2013

Automatic whole number sequences in PowerShell

Try this:

 5..15 | ForEach {Write-Host $_}

That's a very interesting way to make some whole number sequences.

It also works in reverse and with negative numbers, i.e. 10..-5 | ForEach {Write-Host $_}

Monday, June 24, 2013

XnView not opening? (solution inside)

I love the XnView image viewer. It is fast and simple, navigation is easy and it has handy hotkeys for rotate\resize\crop\save(as) functions (the only editing functions I require from an image viewer)

One day the XnView stopped opening :(

Either if I opened XnView from Start Menu or if I opened an image with it - XnView program just appeared in the taskbar but the actual window never appeared :(. I even reinstalled it but no luck, it still wasn't opening.

Here is what I did to fix this:

I went to the C:\Users\ubeogesh\AppData\Roaming\XnView (ubeogesh is the username) folder and deleted the XnView.ini file and that fixed the problem. It may be that some setting inside the XnView was corrupt, but I don't really care. The few settings I use are quite easy to reconfigure rather then digging inside that INI file.

Note that this works only if you choose the default option when starting XnView (store XnView settings in INI file per-user)

Logitech G500 not detected? (solution inside)

I was installing Logitech Gaming Software for my G500 mouse, and the Gaming software kept showing the  "No devices detected" message:

So I looked up in the device manager and checked the mouse driver - it was showing "HID-compliant mouse". I expected after installation it to show something like "Logitech G500 Mouse"...

So then I looked up the folder where Logitech Gaming Software was installed (C:\Program Files\Logitech Gaming Software by default) and there was a folder "Drivers"!

Great, I've selected the "HID-compliant mouse" and opened "Update Driver Software..." from the context menu. There you go to "Browse my computer for driver software" and choose the folder with Logitech drivers:
Press Next and the wizard will tell you that it installed the "Logitech HID-compliant G500 Gaming Mouse" :)

Open up the Logitech Gaming Software and the G500 will be detected :)

Tuesday, May 21, 2013

How to generate many GUIDs using PowerShell

Use this simple PowerShell script:

$i = 1
do {
    $guidObject = [System.Guid]::NewGuid()
    Write-Output $guidObject.Guid >>c:\1.csv
    $i++ }
while ($i -le 1000)

Save the code above to a file with .ps1 extension, right click on it -> Run with PowerShell. 1000 random the GUIDs will be written to a file named C:\1.csv

To run PowerShell scripts, you need to configure PowerShell to allow them. Run in PowerShell:

Set-ExecutionPolicy -ExecutionPolicy Unrestricted

When prompted, type Y and press enter.

Friday, April 26, 2013

How to add bookmarks in steam overlay UI

Yes! You can do that! You can add bookmarks to steam overlay UI, so you can one-click open them in browser in-game. This is not super easy, but not hard at all

What do you need:
1) Page URL
2) Text editor

How to do that:

1) Open your steam folder, navigate to \resource\layout\ folder
2) Find overlaydesktop.layout file and open it with any text editor. The file format is similar to JSON.
3) In the text editor, in "controls" section, add following line:
BookmarkID { controlname="URLLabel" labeltext="Your bookmark name here" urltext="your page URL here" style="sidemenu"}

Creating a new control in steam overlay

BookmarkID is something that you will refer this bookmark in next step
4) In "layout" section, add your BookmarkID to the list in following line:
place { controls="GameGroupsButton,ChatRoomButton,DLCButton,GuideButton,LegacyCDKeyButton,WebSiteButton,RecommendButton,WorkshopButton" y=50 align=right region=overlay dir=down spacing=10 }

Adding a link to steam overlay layout

5) Save the file and you're done!
Here is how it looks: