понедельник, 12 июля 2010 г.

SquidNT + Windows Seven + NTLM

By default, NTLM-authentication is disabled on Windows 7.
To turn it on, open local security (secpol.msc), then Local Policies - Security Options - Network security: LAN Manager authentication level, set it to: "Send LM & NTLM..."

If your Windows 7 system is Windows 7 Home Premium, you may need to configure it via 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.

вторник, 22 июня 2010 г.

Symphony CMS + nginx config

My primitive nginx site configuration for symphony-cms  (nginx + php-fpm):

server{
 listen 80;
 server_name mydomain.com www.mydomain.com;
 access_log /var/log/nginx/mydomain.access.log;
 #access_log off;
 error_log  /var/log/nginx/mydomain.error.log;
 client_max_body_size 50m;

 root /var/www/mydomain/docs;
  
 location / {
 index index.php index.html;
 
 if (-f $request_filename){
   access_log off;  
   expires   30d;
   break;
 }
 
### BACKEND
 if ($request_filename ~ /symphony/) {
         rewrite ^/symphony/?$ /index.php?mode=administration&$query_string last;
            rewrite ^/symphony(/(.*/?))?$ /index.php?symphony-page=$1&mode=administration&$query_string last;
        }
        
 ##IMAGE RULES
 rewrite ^/image/(.+\.(jpg|gif|jpeg|png|bmp|JPG|GIF|JPEG|PNG|BMP))$ /extensions/jit_image_manipulation/lib/image.php?param=$1 last;

 ### CHECK FOR TRAILING SLASH - Will ignore files
    if (!-f $request_filename) {
          rewrite ^/(.*[^/]+)$ /$1/ permanent;
     }

     ### MAIN REWRITE - This will ignore directories
 if (!-d $request_filename) {
          rewrite ^/(.*)$ /index.php?symphony-page=$1 last;
          
     }

}

# error_page  404              /index.php;
 
 ## Images and static content is treated different
    location ~* ^.+.(xml)$ {
      access_log        off;
      expires           30d;      
    }


## Parse all .php file in the /var/www directory
    location ~ .php$ {
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_pass   backend;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        
        include fastcgi_params;
        fastcgi_param  QUERY_STRING     $query_string;
        fastcgi_param  REQUEST_METHOD   $request_method;
        fastcgi_param  CONTENT_TYPE     $content_type;
        fastcgi_param  CONTENT_LENGTH   $content_length;
        fastcgi_param DOCUMENT_URI      $document_uri;
        fastcgi_param DOCUMENT_ROOT     $document_root;
        fastcgi_intercept_errors        on;
        fastcgi_ignore_client_abort     off;
        fastcgi_connect_timeout 60;
        fastcgi_send_timeout 180;
        fastcgi_read_timeout 180;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 4 256k;
        fastcgi_busy_buffers_size 256k;
        fastcgi_temp_file_write_size 256k;
    }

## Disable viewing .htaccess & .htpassword
    location ~ /\.ht {
        deny  all;
    }
}
upstream backend {
        server 127.0.0.1:9000;
}

понедельник, 7 июня 2010 г.

ANTIVIRUS. Useful registry tips

1. Вернуть Реестр: В "Пуск" - "Выполнить" вставить следующую команду:

REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableRegistryTools /t REG_DWORD /d 0 /f

2. Вернуть Диспетчер Задач: В "Пуск" - "Выполнить" вставить следующую команду:
REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 0 /f

3. Проверить:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

Shell=Explorer.exe
вместо
Shell=VirusName

4. Проверить:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"Userinit"="C:\WINDOWS\system32\userinit.exe,"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"PersistBrowsers"=dword:00000000


5. Disable Software Restriction Policy:
    SRP_Disable – включает уровень политики в Unrestricted:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\safer\codeidentifiers]
"authenticodeenabled"=dword:00040000

6. Disable Windows Installer
System Key: [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer]
Value Name: DisableMSI
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = default, 1 = admin only, 2 = disabled)

7. AutoRUN keys

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce\Setup


http://support.microsoft.com/kb/137367

8. Delete everything in:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\\AppInit_DLLs

9...

вторник, 25 мая 2010 г.

Ubuntu Linux: slow login to SSH server

The solution is rather simple:
sudo echo "UseDNS no" >> /etc/ssh/sshd_config

среда, 19 мая 2010 г.

Permissions to install flash player on Terminal Server

Here is how to fix this problem when using TS. I have tested it both on the 32-bit version of Windows Server 2003 and the x64 version. Works (for me):

1. Download the latest Flash uninstaller on this page: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14157&sliceId=1 and place it somewhere on your hard disk (C:\Temp is a good place)
2. Open a command prompt, navigate to the folder where you placed the uninstaller and run it with the "/clean" option, like this: "uninstall_flash_player.exe /clean" (without quotes - thanks Adobe for so clearly documenting any command line options for this tool...NOT !)
3. Click the Details button. If it lists any files as "Delete on reboot", then reboot now. Otherwise, just carry on.
4. Download the EXE installation package from here:
http://www.adobe.com/support/flashplayer/ts/documents/tn_19166/Install_Flash_Player_9_ActiveX.zip
5. Use the Control Panel Add/Remove programs method to install it. This ensures that the Windows install notification API triggers correctly (as opposed to executing change user /install in a command prompt).
6. Use regedit and find the following key: HKCR\CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000} (on 64-bit Windows this one is located under HKCR\Wow6432Node\CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000})
7. Remove any permissions for the Everyone group. click Advanced and tick the box to propagate the permissions to all child objects.
8. Add the Everyone group and give it "Read" permissions on the key. Again, click the Advanced button and propagate the permissions to all child objects.
9. Repeat steps 6 to 8 on the subsequent key, called HKCR\CLSID\{D27CDB70-AE6D-11cf-96B8-444553540000}

Log on as a norrmal user and test it.

Provided that the uninstaller did not report that it needed a reboot in step 3, all this can be done and will start working immediately, even with active users logged on and running several instances of IE on the Terminal Server.