Oct 31, 2012

Converting SID to Windows account without typing SID

You have something like this and you want to know who the hell this string of number is.


I dont know if there is an easier way, but a few years ago I wrote a powershell function which I will share with you:


function ConvertTo-NtAccount ($sid) {(new-object system.security.principal.securityidentifier($sid)).translate([system.security.principal.ntaccount])}
function ConvertTo-Sid ($NtAccount) {(new-object system.security.principal.NtAccount($NTaccount)).translate([system.security.principal.securityidentifier])}


But then you still have to type this damn string... nope
Since you're already in powershell, just execute:
(acl "FILE NAME HERE").access
You'll get something like this:
FileSystemRights  : DeleteSubdirectoriesAndFiles, Delete
AccessControlType : Allow
IdentityReference : S-1-5-21-123456789-12345678777-722323232-654321
IsInherited       : True
InheritanceFlags  : None
PropagationFlags  : None 
Now simply run
ConvertTo-NtAccount S-1-5-21-123456789-12345678777-722323232-654321

BOOM
You're welcome

PS: as a funny side note, I forgot about ACL command, and not wanting to type the SID by hand I looked for alternative. The most natural alternative I came up with was OneNote. Print screen the properties box, paste into One Note, right click and select "Copy Text from Image". Paste. A bit backasswards but it works.


Oct 25, 2012

Chrome forever

While publishing some stuff on confluence I realized that there is no way to render Viso files. You gotta save them as .JPG and attach both. What a pain.

But wait. There is a way. Apparently Confluence has a plugin that can use IE native Visio rendering functionality to display Visio. And apparently there is a fantastic plugin for Chrome: "IE Tab".

The two most popular ones are here (source of the discovery here):
http://www.ietab.net/ie-tab-documentation?from=chromeurl
http://iblogbox.com/chrome/ietab/alert.php

I've installed both to try them out. Be warned, I don't know which one steals more of your private data, so as they say in the blogosphere: "YMMV".


Unrelated image:



Oct 17, 2012

Cheating in style

There is a great page out there that's been making my life more enjoyable: xkcd...


There is another, equally useful site, which I've been using for around a year.. but only for RegEx.. today I found a slew of other cheats: http://www.addedbytes.com/cheat-sheets/

Examples:

Oct 15, 2012

SQL management studio (SSMS) line wraps.

I was surprised to find that Release Engineer was available in the bloggosphere and promptly staked a claim to the name.

Today's 10 seconds of saved productivity is represented by Line Wrap in sql management studios: http://www.mssqltips.com/sqlservertip/1623/easier-way-to-read-your-tsql-code-in-ssms-with-word-wrap-feature/


Solution: Line many new features in SQL Server Management Studio (SSMS), Microsoft has also addressed the word wrap issue. You can easily turn on this feature for the SSMS query pane, just follow the steps below to turn on this feature.. From the SSMS menus select "Tools" and then "Options"


Check the check box for "Word wrap" and "Show visual glyphs for word wrap".

Vola! No more single-line queries running off into the abyss.