Friday, October 9, 2015

Computer waking up from sleep and you don't know why?

Controlling which devices will wake the computer out of sleep:

If your computer keeps waking up from standby/sleep, here is how to figure out what causes it.

1) Open a command prompt with Administrator privileges and run the command:
powercfg -devicequery wake_armed
2) You see a list of devices that have permission to wake up your computer. You can disable each of these devices one by one until you find the one that is waking up the computer by running this command with the name of the device listed in quotes:
powercfg -devicedisablewake "device name"
Once you find the one that is causing problems, you can re-enable the others:
powercfg -deviceenablewake "device name"
You can get a more detailed list of devices capable of waking up your computer with the command:
powercfg -devicequery wake_from_any

I had my LAN-card causing the problem, and got it disabled by running this:
 powercfg -devicedisablewake "Realtek PCIe GBE Family Controller"
You may have a problem with your mouse moving a little, which causes the computer to wake up. You can either turn the mouse upside down, or disable it's ability to wake up the computer for good.

Thursday, October 23, 2014

Passing all parameter arguments to irssi alias

$*        expands to all arguments passed to an alias
 
so for example, making alias /self which sends all arguments passed to it to myself using network 'Network' :
/alias self /msg -Network $N $*

Adding left navigation menu bar to Sharepoint 2010 Web Part page

Open your Web Part page in Sharepoint Designer.

Step 1 – Remove CSS
Around line 34 you will find a code block like the one below

<SharePoint:UIVersionedContent ID="WebPartPageHideQLStyles" UIVersion="4" runat="server">
<ContentTemplate>
<style type="text/css">
body #s4-leftpanel {
display:none;
}
.s4-ca {
margin-left:0px;
}
</style>
</ContentTemplate>
</SharePoint:UIVersionedContent>


Delete this code block.


Step 2 – Remove the overrides for the left column

Further down you will find three lines which prevents the left column for rendering.

<asp:Content ContentPlaceHolderId="PlaceHolderPageImage" runat="server"></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderNavSpacer" runat="server"></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"></asp:Content>

Remove all three lines.

Step 3 – Save the page

Wednesday, September 24, 2014

How to format Date / DateTime fields in Sharepoint 2010 using custom xsl and ddwrt formatting

When getting Calendar items, use ddwrt:FormatDate to format Date/Time as your liking:

from <xsl:value-of select="ddwrt:FormatDate(string(@EventDate),2057,3)"/>
to <xsl:value-of select="ddwrt:FormatDate(string(@EndDate),2057,3)"/>


Also, you can use custom formatting with this:
<xsl:variable name="monthy" select="ddwrt:FormatDateTime(string(pubDate), 1033, 'MMMM')"/>


More Links to help you:
Available locales
Custom date formats
MSDN DateTime custom format
ms:format-date Function
XSLT Date format dd-MMM-yyyy using ddwrt:FormatDateTime
ddwrt FormatDate and FormatDateTime
How to format date value in SharePoint Data View Web Part – xslt

Monday, September 22, 2014

Weird flickering effect with HTML/CSS

Just found out that when using in-page popups, using this CSS breaks the page so that it starts flickering/strobing constantly sometimes :D
html {overflow: auto;}

So word of advice: don't use it :) Or use it with some other parameter than "auto".

How to configure Firefox to automatically reuse the login credentials like IE

You need to enable NTLM Configuration within FireFox. It is very simple to do and should solve your problem:

Open Firefox and type “about:config” in the address bar. (without the quotes of course)
In the ‘Filter’ field type the following “network.automatic-ntlm-auth.trusted-uris”
Double click the name of the preference that we just searched for

Enter the URLs of the sites you wish to pass NTLM auth info to in the form of:

http://intranet.company.com,http://email.company.lan

Notice that you can use a comma separated list in this field.

Thursday, September 18, 2014

How to disable the mystical 1px or 2px padding in table / tbody elements in Sharepoint 2010

Ever wonder, why tables get mystically some 1-2px padding around them? And any Developer console(F12) or Firebug won't show you why?
Well here's why. I guess Sharepoint(or Webkit) mystically adds a 1px invisible border around tables. Here is how to disable it with CSS:
table { border-collapse: collapse!important;}