PowerTab – Powershell Error

 

Since I installed PowerShell 3 CTP 2 I’ve got his error when starting:

powertab

or by text

You are now entering pwrshll: ********

PS D:\reiser\Powershell\Scripts> Import-Module PowerTab
Get-Content : Cannot find path ‘Function:\TabExpansion’ because it does not exist.
At D:\DOCUMENTE\Documents\WindowsPowerShell\Modules\PowerTab\PowerTab.psm1:17 char:20
+ $OldTabExpansion = Get-Content Function:TabExpansion
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Function:\TabExpansion:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

PowerTab version 0.99.6.0 PowerShell TabExpansion Library
Host: ConsoleHost
PowerTab Enabled: True

Now when I installed PowerShell 3 RTM I’ve finally got annoyed by this message (I load powertab from within the profile) so I’ve done some research.

Seems that in PowerShell 3 TabExpansion has been replaced with TabExpansion2 : https://github.com/psget/psget/issues/16

So the only thing you will have to do is to modify the script PowerTab.psm1 , at line 17 char 20, instead of TabExpansion you should have TabExpansion2 like below:

powertab1

The script should be located either in the PowerShell’s allusers(computer) profile here:

"$PSHOME\modules\Powertab\PowerTab.psm1" or "$((($env:psmodulepath).Split(";"))[1])\powertab\powertab.psm1”

(ussually C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PowerTab\PowerTab.psm1)

or in your user profile:

"$((($env:psmodulepath).Split(";"))[0])\powertab\powertab.psm1” (ussually C:\Users\%username%\documents\WindowsPowerShell\Modules\PowerTab\PowerTab.psm1)

After that, no error occurs anymore as here:

powertab2

Enjoy!

Quinto Labs Content Security 2 Django Error

So if you follow exactly the tutorial on integrating with apache you won’t get into any trouble. But if you don’t, and the line:

$sudo ./qlproxy_django/bin/easy_install django==1.3.1 lacks the version number or you’ve got previously a newer django version, you’ll get into an error like this:

ImportError at /
Import by filename is not supported.Request Method: GET
Request URL: http://hostname/
Django Version: 1.4
Exception Type: ImportError
Exception Value: Import by filename is not supported.
Exception Location: /var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/utils/importlib.py in import_module, line 35
Python Executable: /usr/bin/python
Python Version: 2.6.6
Python Path: [‘/usr/local/lib/python2.6/dist-packages/virtualenv-1.7.2-py2.6.egg’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages/pip-1.1-py2.6.egg’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages/Django-1.4-py2.6.egg’,
‘/usr/lib/python2.6’,
‘/usr/lib/python2.6/plat-linux2’,
‘/usr/lib/python2.6/lib-tk’,
‘/usr/lib/python2.6/lib-old’,
‘/usr/lib/python2.6/lib-dynload’,
‘/usr/local/lib/python2.6/dist-packages’,
‘/usr/lib/python2.6/dist-packages’,
‘/usr/lib/pymodules/python2.6’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy/’,
‘/var/opt/quintolabs/qlproxy/www/qlproxy_django/lib/python2.6/site-packages’]

The error appear because you have a newer Django version than 1.3.1.

This error and a lot more information would appear only if you have DEBUG = True in your Django settings file.

Recovering from this is pretty simple:

 

#apt-get install httpd mod_wsgi python-setuptools
#easy_install virtualenv
#cd /var/opt/quintolabs/qlproxy/www
#virtualenv –no-site-packages qlproxy_django
#./qlproxy_django/bin/easy_install *django==1.3.1*

Got from here:

http://groups.google.com/group/quintolabs-content-security-for-squid-proxy/browse_frm/month/2012-04

Squidview + Squid 3

I post this as a reminder, the solution to this problem found on this post: http://adminnetworks.blogspot.com/2011/05/instalar-squidview-en-debian.html

So what is all this about? When I first installed Squid v3 on a system and tried to run Squidview (of course everyone knows tail –f /var/log/squid3/access.log) but got this error: “The squid log file cannot be read.

It was clear enough that it looks for the log file in a place that doesn’t exist so I guessed that’s the location of the old 2.x Squid, /var/log/squid/access.log . But to my surprise squidview doesn’t have any config file, the location is hardcoded.

So the solution is to create a softlink like this:

ln -s /var/log/squid3/ /var/log/squid

Now squidview starts as it should. That simple!

WSUS: Error 10032 Source Windows Server Update – Solved

 

I was consistently getting the error 10032 on the server that hosts my WSUS 3 server.

Wsusdebug0

The error sounded so generic that I first looked on http://eventid.net for the error. One of the sollutions pointed to this:

http://www.microsoft.com/technet/support/ee/transform.aspx?ProdName=.NET+Framework&ProdVer=2.0.50727&EvtID=10032&EvtSrc=Windows+Server+Update+Services&LCID=1033

  1. Open a command window.
  2. Type sc config bits start= auto
  3. Type net stop bits && net start bits
  4. Type net stop wsusservice && net start wsusservice
  5. Start WSUS 3.0: Click Start, click Administrative Tools, then click Microsoft Windows Server Update Services v3.0.
  6. Click Synchronization Results.
  7. In the Action pane, click Synchronize Now.

and in the end:

  1. Type cd <WSUSInstallDir>\Tools
  2. Type wsusutil checkhealth
  3. Type eventvwr
  4. Review the Application log for the most recent events from source Windows Server Update Services and event id 10030.

Now when checking the eventviewer I get error 10032 and a more consistent error 364 source Windows Server Update:

Wsusdebug1

After a new search this: http://msmvps.com/blogs/athif/archive/2005/10/27/Purge-Delete-the-downloaded-patches-on-WSUS-Server.aspx

pointed me to the solution: WSUSDEBUG PurgeUnneededFiles .

You simply donwload the WSUSDEBUG tool(server diagnostic tool) from here: Server Diagnostic Tool

Unpack it to any location on the server that you like (ex: C:\Program Files\Update Services\Tools ), and run:

WsusDebugTool.exe /Tool:PurgeUnneededFiles

Wsusdebug2

That solved my problem and also cleaned up to 10GB on the drive that the WSUS content resided.

Of course that depends on the Products and Classifications options that you’ve chosen for your server.

After WSUSUTIL checkhealth I got in eventviewer these 2 events(10030 and 10000):

Wsusdebug4Wsusdebug3

That means that everything is ok with the WSUS server Smile

More WSUS Server stuff here:

http://technet.microsoft.com/en-us/wsus/default