Tagconfigure

Replacing a string in each user’s profile

This routine replaces a string in the text file user.js.  The file is located in each user’s profile which also contains a random string as part of the path name.

Imports System.Net
Imports System.IO

Public Class Form1

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
 Dim strPath As String = "c:\users"
 Dim arrFolders() As String = System.IO.Directory.GetDirectories(strPath)
 Dim MozPath As String

'----------------------------------------------------------------
 ' get list of profiles
 '----------------------------------------------------------------
 For Each arrFolder As String In arrFolders
 MozPath = arrFolder & "\AppData\Roaming\Mozilla\Firefox\Profiles\"

If My.Computer.FileSystem.DirectoryExists(MozPath) = True Then
 Dim arrGUIDpath() As String = System.IO.Directory.GetDirectories(MozPath)

For Each arrGUIDfolder As String In arrGUIDpath
 If My.Computer.FileSystem.FileExists(arrGUIDfolder & "\user.js") = True Then
 Console.WriteLine("notepad " & arrGUIDfolder & "\user.js")

'----------------------------------------------------------------
 ' 1. rename the user.js file
 ' 2. replace the proxy defintion string tinto user.js
 '----------------------------------------------------------------
 Try
 My.Computer.FileSystem.DeleteFile(arrGUIDfolder & "\user2.js")
 Catch ex As Exception
 Application.DoEvents()
 End Try

My.Computer.FileSystem.CopyFile(arrGUIDfolder & "\user.js", arrGUIDfolder & "\user2.js")

My.Computer.FileSystem.WriteAllText(arrGUIDfolder & "\user.js", _
 My.Computer.FileSystem.ReadAllText(arrGUIDfolder & "\user2.js").Replace("user_pref(""network.proxy.type"", 4);", _
 "user_pref(""network.proxy.type"", 0);"), False)
 End If

'----------------------------------------------------------------
 ' clean up to avoid confusion in the future
 '----------------------------------------------------------------
 Application.DoEvents()

Try
 My.Computer.FileSystem.DeleteFile(arrGUIDfolder & "\user2.js")
 Catch ex As Exception
 Application.DoEvents()
 End Try
 Next
 End If

Next
 End
 End Sub

End Class

Get the Old Chrome Bookmark Manager Back

Get the Old Chrome Bookmark Manager Back

The newest version of Chrome features a fancy new bookmark manager and interface that’s all about thumbnails. If you’re not a fan of that snazz, Techdows points to a flag you can switch to get the old interface back.

Getting the old interface back is easy:

  1. Head to chrome://flags/#enhanced-bookmarks-experiment
  2. Change the setting to “Disabled” and click “Relaunch Now”

That’s it, when Chrome reopens, you’ll be back to the old view.

From: Lifehacker

SQL Studio: Clear Server List

Over time, SQL Server Management Studio’s Server Dropdown box gets cluttered with many servers.  Quite often some of the servers no longer exist.  However, SQL Studio does not give the user an option for clearing this list.  I found this to be very frustrating.  The instructions below show how this can be done.

I tested these instructions with SQL Studion 2008 running on Windows XP and Windows 7.

SQL Server 2008 running on Windows XP:

  1. Close SQL Studio if it is open
  2. Go to C:\Documents and Settings\Application Data\Microsoft\Microsoft SQL Server\100\Tools\Shell
  3. Delete the file SqlStudio.bin
    The file will be recreated automatically when SQL Studio starts.

SQL Server 2008 running on Windows 7:

  1. Close SQL Studio if it is open
  2. Go to C:\Users\AppData\Roaming\Microsoft\Microsoft SQL Server\100\Tools
  3. Delete the file SqlStudio.bin
    The file will be recreated automatically when SQL Studio starts.

Special thanks to Dave Pinal at http://www.SQLAuthority.com for providing this information.

Configuring IIS Application Pool

IIS Application Pool contains all web applications on domains hosted on your server. Dedicated IIS application pool allows your clients to have a level of isolation between web applications used by their domains. Since each dedicated application pool runs independently, errors in one application pool belonging to one client will not affect the applications running in other application pools belonging to other clients.

By default, Plesk offers a shared application pool for all your clients and their customers. However, clients and domains can use dedicated application pools if administrator and client policy permit this.

IIS application pool can work in three modes:

  • Shared pool is always used for all clients and domains.
  • Dedicated pool is always used for every client and domain.
  • Shared pool is used for clients and domains by default; clients are allowed to assign dedicated pools for their customers.

To change the IIS application pool working mode:

  1. Go to Server > IIS Application Pool.
  2. Select Global Settings tab.
  3. Select the required mode and click OK.

To limit the amount of CPU resources that the IIS application pool can use:

  1. Go to Server > IIS Application Pool.
  2. Select the Switch on CPU monitoring check box and provide a number (in percents) in the Maximum CPU use (%) field.
  3. Click OK.

To stop all applications running in the server application pool:

  1. Go to Server > IIS Application Pool.
  2. Click Stop.

To start all applications in the application pool:

  1. Go to Server > IIS Application Pool.
  2. Click Start.

To restart all applications running in the application pool:

  1. Go to Server > IIS Application Pool.
  2. Click Recycle. This can be handy if some applications are known to have memory leaks or become unstable after working for a long time.

via Configuring IIS Application Pool.