Technology and me

// Windows 2008 R2 Server : Windows directory's size growing a lot

I use Zabbix for monitoring some servers at work and I found that the free space on a Windows Server 2008 (only used as a Web server) was decreasing slowly for 3 months (almost 1Go a month). I'm still safe as I followed Microsoft guideline and had a system partition with 40Go.

At first I thought some colleague used it to store some temporary file or that some program was leaking too much log. But after some digging the main growing directory is Windows.

I looked on the Internet and found many links about the mighty directory Winsxs and no real solution. I also found that the space used by the directory is false in the explorer because hard links are not handled correctly.

After having laughed and cried a little, I found this link which allow you to regain a little space.

// With IIS 7.5 I had an error about PageHandlerFactory-Integrated and ManagedPipelineHandler

The error is : Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list.

For an unknown reason, the link between IIS and ASP.net is not correct so you'll have to register the framework into IIS. In my case the solution was :

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

If your server is not 64 bits change Framework64 with Framework.

If your problem is not caused by the framework 4.0 change the directory accordingly.

Source : http://wishmesh.com/2010/08/iis-7-5-error-handler-pagehandlerfactory-integrated-has-a-bad-module-managedpipelinehandler-in-its-module-list/

// How to have a secure ssh server

There's is some easy steps to follow :

PermitEmptyPasswords no
  • You can also use fail2ban to ban script kiddies.

// How to open an ssh session with a private key

First you'll have to have a private key setup. Then :

  • Create the .ssh directory and secure it :
mkdir .ssh
chmod 700 .ssh
  • Then create the authorized_keys and secure it
cd .ssh
touch authorized_keys
chmod 600 authorized_keys
  • Then copy your public key to authorized_keys
  • Enjoy

As a side note you can use pageant and putty to connect through private key on Windows.

// How to find unindexed foreign key with Oracle

All credits to : this post. Here is the script :

SELECT table_name, constraint_name,
          cname1
       || NVL2 (cname2, ',' || cname2, NULL)
       || NVL2 (cname3, ',' || cname3, NULL)
       || NVL2 (cname4, ',' || cname4, NULL)
       || NVL2 (cname5, ',' || cname5, NULL)
       || NVL2 (cname6, ',' || cname6, NULL)
       || NVL2 (cname7, ',' || cname7, NULL)
       || NVL2 (cname8, ',' || cname8, NULL) COLUMNS
  FROM (SELECT   b.table_name, b.constraint_name,
                 MAX (DECODE (POSITION, 1, column_name, NULL)) cname1,
                 MAX (DECODE (POSITION, 2, column_name, NULL)) cname2,
                 MAX (DECODE (POSITION, 3, column_name, NULL)) cname3,
                 MAX (DECODE (POSITION, 4, column_name, NULL)) cname4,
                 MAX (DECODE (POSITION, 5, column_name, NULL)) cname5,
                 MAX (DECODE (POSITION, 6, column_name, NULL)) cname6,
                 MAX (DECODE (POSITION, 7, column_name, NULL)) cname7,
                 MAX (DECODE (POSITION, 8, column_name, NULL)) cname8,
                 COUNT (*) col_cnt
            FROM (SELECT SUBSTR (table_name, 1, 30) table_name,
                         SUBSTR (constraint_name, 1, 30) constraint_name,
                         SUBSTR (column_name, 1, 30) column_name, POSITION
                    FROM user_cons_columns) a,
                 user_constraints b
           WHERE a.constraint_name = b.constraint_name
             AND b.constraint_type = 'R'
        GROUP BY b.table_name, b.constraint_name) cons
 WHERE col_cnt >
          ALL (SELECT   COUNT (*)
                   FROM user_ind_columns i
                  WHERE i.table_name = cons.table_name
                    AND i.column_name IN
                           (cname1,
                            cname2,
                            cname3,
                            cname4,
                            cname5,
                            cname6,
                            cname7,
                            cname8
                           )
                    AND i.column_position <= cons.col_cnt
               GROUP BY i.index_name)
/

Just a quick addition : all foreign key don't have to be indexed but many do.

RSS Feed
Social ...
Sauf mention contraire, le contenu de ce wiki est placé sous la licence suivante : CC Attribution-Noncommercial-Share Alike 3.0 Unported