Monday, August 23, 2010

More For Windows 7 Sharing

I believe this is the GUI procedure for the previous post...

Please follow change the NTLM authentication level.
Network security: LAN Manager authentication level
To change the policy, open gpedit.msc from Start Search box, locate to:
Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options\Network security: LAN Manager authentication level
Change the value to “Send LM & NTLM - use NTLMv2 session security if negotiated”.
If your system is Windows 7 Home Premium, you may change it from Registry.
1. Launch regedit from Start Search box.
2. Find the following branch.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
3. Create a DWORD key under Lsa and set:
Name: LmCompatibilityLevel
Value: 1
4. Restart.

Monday, August 9, 2010

Win 7 Administrative Shares

Windows 7 still creates the administrative shares on install, but you can't use them out of the box. First of all, you need to have File and Printer Sharing enabled. And the way to do that has once again been changed:

  1. Open the control panel.
  2. Go to Network and Internet.
  3. Go to Network and Sharing Center.
  4. In the left column, click on Change advanced sharing settings.
  5. There are two profiles. You probably don't want this on when you're on a public network so open Home or Work.
  6. Under the header File and Printer sharing, select the Turn on... option.

And now your administrative shares still don't work :-P You've just completed step 1 which implies there's at least a step 2 and here it is: you also need to change the registry.

  1. Click on the orb (= the round button with the Windows logo in the taskbar) and type regedit in the search box.
  2. Open the registry editor.
  3. Navigate all the way toHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System.
  4. Right-click in the pane on the right side and add a new DWORD (32-bit).
  5. Give the new setting the name LocalAccountTokenFilterPolicy.
  6. Double click on that setting and give it a value of 1.

It's probably wise to reboot after doing this, although it might not be needed. I'm not sure if it works straight away because I rebooted without trying.

Anyways, if you're lucky you will be able to access administrative shares after performing these steps. If you're unlucky, like me, doing all these things appears to have zero effect at all. Once again don't panick, because there's another hint/tip/solution coming your way.

Somewhere at some point during the installation or configuration of Windows 7, you will be asked to do something with a thing called Homegroup. It's some weird new sharing tool that looks OK but isn't quite what you're used to. Once you have enabled that feature, you won't be able to use the administrative shares. So the tip is: disable the homegroup feature.

  1. Open the control panel.
  2. Go to Network and Internet.
  3. Go to HomeGroup.
  4. Click on the blue link Leave the homegroup.

Wednesday, March 17, 2010

Force links in certain div to open in new window (javascript)

revision of earlier code...useful for Blogger templates.  changes only links in blog post. Add an HTML widget to your template. Add this function in your body onload event<body onload="ForceLinks();"> 

<script language='javascript'>
function ForceLinks()
{
// It will tell u how many no of tags your code have
var linkslength= document.getElementById('Blog1').getElementsByTagName('a').length;

// Putting tag in links variable to use it for array purpose
var links=document.getElementById('Blog1').getElementsByTagName('a');

for(var i = 0; i < linkslength; ++i)

{

links[i].setAttribute('target','_blank');

}

}
</script>

Force all links on page to open in new window (javascript)


function ForceLinks()

{
// It will tell u how many no of tags your code have
var linkslength= document.getElementsByTagName('a').length;

// Putting tag in links variable to use it for array purpose
var links=document.getElementsByTagName('a');

for(var i = 0; i < linkslength; ++i)

{

links[i].setAttribute('target','_blank');

}

}

Now just call this function in your body onload event<body önload="ForceLinks();"> 

Friday, February 5, 2010

Reset Windows 2000 Remote Administration Sessions

"The terminal server has exceeded the maximum number of allowed connections"

To use the command line hacks, you might need to run them from another server if your local operating system doesn't include the commands. You will also need to make sure that you are logged onto that server with an administrative account. The easiest way to do that is just map a drive (you don't have to use a drive letter unless you choose to)

   net use /user:[username] \\servername\share

Here's a command line hack that you can use to figure out what sessions are connected to the server. Note that you could substitute the IP address for the server name.

   query session /server:servername


Now we know that the session ID of the offending session is 2. We can use that in the next step, which is using the reset command to log off that user.

   reset session [ID] /server:servername

Friday, December 11, 2009

Restore Your Registry Using The Recovery Console


I. Boot to Recovery Console/ BART PE/ etc
 

II. Restore  the registry with the steps below.

1. Type: cd \
( Reminder: between "cd" and "\" there should be a "blank space" otherwise  the command won't work. These are similar to old DOS commands where spaces had to go between each command so DOS knew where one command stopped and another started.)
 
2.Type: Cd system~1\_resto~1
If it gives an error "Access Denied" while accessing the folder, follow the method below
Type: cd \ 
Then click enter
Type: cd windows\system32\config 
Then click enter
Type: ren system system.bak 
Then click enter
(note the spaces between ren and system, and then between system and system.bak)
Type: exit
Then click enter
 now the computer should restart, then follow steps 1-6 of the article.

 
3.Type: dir
Then click enter
NOTICE: When you hit enter it will list all the restore points folders like "rp1", "rp2" we have to see the last restore point to copy the file from a recent backup. If the restore points have more than one page then you have keep on hitting the key to view the last restore point folder.
NOTICE: It is a good rule of thumb to choose the files from the restore point folder which the second to the last one.
4.Type: cd rp {with the second to the last restore point no. } (Note: Example: cd rp9. if rp10 is the last restore point. where last restore point no. =10)
Then click enter
5.Type: cd snapshot
NOTICE: Now the command Prompt will look like this
c:\system~1\resto~1\rp9\snapshot
( Note : restore point 9 assumed for clarity of the content, you have to go to the last restore point folder as described in the previous lines) Now according to the error message we have to copy the appropriate file from the restore point folder.

 

III.

NOTE: The appropriate command should be used according to the error message. But often times I do both to make sure they match each other.
 
If the file "system" is corrupted

Type: copy _registry_machine_system c:\windows\system32\config\system

Then click enter

 

If the file "software" is corrupted

Type: copy _registry_machine_software c:\windows\system32\config\software

Then click enter

Type: Exit 

Then click enter to restart computer and boot to the hard drive normally.

 

If this does not work, then you should try an earlier restore point. Normally 2 or 3 more restore points back. If that does not work your drive may be corrupt. At this point you will have a couple of different options.

1: You can copy your drive to a new drive and then try again. Make sure the software you use copies the restore folder with the rest of the windows system. Some do not move the system restore folder over to save time and space, but you can manually tell the program to move the restore folder. I use Casper XP, and it has the option to move the restore folder.

NOTE: Only do step 2 if the above has failed. Step 2 will remove all system restore points from your system and as far as I can tell they will be gone forever unless you have a copy of your hard drive. Also this should remove all MS updates and service packs and you will have to do your windows updates over again.

2: Another is to start the system from the cd as described previously and then, instead of loading the command prompt by clicking "R" at the first recovery prompt, you tell it to install windows and after you click the F8 key to agree to the End User License, you then will be given a chance to recover a previous version of windows (if the installation software does not recognize a previous version of windows !!!"STOP"!!!, or you will loose everything on the drive). Carefully follow through that repair setup wizard and that may also fix your problem. 

Wednesday, November 11, 2009

Joomla redirect and URL rewriting in IIS7

Create or edit your global.config (or web.config) file:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="RedirectRule" stopProcessing="true">
          <match url=".*" />
          <conditions>
            <add input="{StaticRedirects:{REQUEST_URI}}" pattern="(.+)" />
          </conditions>
          <action type="Redirect" url="http://www.elatum.com{C:1}" appendQueryString="False" redirectType="Permanent" />
        </rule>
        <rule name="Redirect to WWW" stopProcessing="true">
          <match url=".*"/>
          <conditions>
            <add input="{HTTP_HOST}" pattern="^elatum.com$"/>
          </conditions>
          <action type="Redirect" url="http://www.elatum.com/{R:0}" redirectType="Permanent"/>
        </rule>
        <rule name="Security Rule" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
          <conditions logicalGrouping="MatchAny">
            <add input="{QUERY_STRING}" pattern="mosConfig_[a-zA-Z_]{1,21}(=|\%3D)" ignoreCase="false" />
            <add input="{QUERY_STRING}" pattern="base64_encode.*\(.*\)" ignoreCase="false" />
            <add input="{QUERY_STRING}" pattern="(\&lt;|%3C).*script.*(\>|%3E)" />
            <add input="{QUERY_STRING}" pattern="GLOBALS(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" />
            <add input="{QUERY_STRING}" pattern="_REQUEST(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" />
          </conditions>
          <action type="CustomResponse" url="index.php" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
        </rule>
        <rule name="SEO Rule">
          <match url="(.*)" ignoreCase="false" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" pattern="" ignoreCase="false" />
            <add input="{URL}" negate="true" pattern="^/index.php" ignoreCase="false" />
            <add input="{URL}" pattern="(/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$" />
          </conditions>
          <action type="Rewrite" url="index.php" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>


In Joomla Admin set:

SEO Url's : Yes
Apache Mod Rewrite: Yes
Add suffix : No