maintenance

How do I monitor and find unused indexes in sql database

断了今生、忘了曾经 提交于 2019-12-03 00:08:59
I would like to monitor index usage for an sql database, in order to find unused indexes and then drop them. How can I monitor index usage most efficiently? And which scripts could be useful? (I'm aware of this question about identifying unused objects , but this applies only to the current run of the sql server. I would like to monitor index usage over a period of time...) Mike Dinescu Currently (as of SQL Server 2005 - 2008) the SQL index stats information is only kept in memory and so you have to do some of the work yourself if you would like to have that persisted across restarts and

Check when password was last changed

僤鯓⒐⒋嵵緔 提交于 2019-12-02 20:47:23
How do I check when the password was last changed for some user? I would like to do it both on Windows and Linux, can you guide me a little how can I do that? In Linux: chage -l {username} In Windows: net user {username} | find /I "Password last set" In Windows (user part of a domain): net user {username} /DOMAIN | find /I "Password last set" * nix Check out the command chage or getprpw Windows net user UserName has the information in it Erik Gump net user UserName /DOMAIN | find /I "Password last set" This command is useful and was able to check my last password change date and time. 来源:

nginx maintenance page with content issue

て烟熏妆下的殇ゞ 提交于 2019-12-02 20:42:29
To show maintenance page during deploy I've always used next config in nginx: if (-f /home/shared/system/maintenance.html) { return 503; } error_page 503 @maintenance; location @maintenance { root /home/shared/errors; rewrite ^(.*)$ /maintenance.html break; } And everything was ok until I needed to add static content to maintenance page (images, stylesheets, etc.) No of static content work with such logs in error.log: 2011/05/05 02:47:20 [notice] 13760#0: *6 "^(.*)$" matches "/some.jpg", client: x.x.x.x, server: server.com, request: "GET /some.jpg HTTP/1.1", host: "server.com" 2011/05/05 02:47

Writing maintainable code [closed]

久未见 提交于 2019-12-02 17:58:08
What is the single most important factor for writing maintainable code (language independent)? Write it for other people to read. This means a combination of good names, good comments, and simple statements. Once upon a time memory was scarce and cycles times were slow. programmers were encouraged to write complex single lines of code that did many things. Today memory is plentiful and cycle times are fast. You should write 5 lines of simple code people can follow instead of one line they cannot understand. Good comments don't have to be long, but they must be helpful. Also be consistent. Do

Is there a way to avoid spaghetti code over the years? [closed]

百般思念 提交于 2019-12-02 14:22:35
I've had several programming jobs. Each one with 20-50 developers, project going on for 3-5 years. Every time it's the same. Some programmers are bright, some are average. Everyone has their CS degree, everyone read design patterns. Intentions are good, people are trying hard to write good code but still after a couple of years the code turns into spaghetti. Changes in module A suddenly break module B. There are always these parts of code that no one can understand except for the person who wrote it. Changing infrastructure is impossible and backwards compatibility issues prevent good features

Inherited a PHP nightmare, where to start? [closed]

江枫思渺然 提交于 2019-12-02 14:03:25
I've inherited a PHP project that's turning out to be a nightmare. Here are the salient points: All the original developers have left The code has no version control All development and testing was done on the live server by renaming and editing the PHP files. There are multiple copies of each file index.php, index2.php, index3.php etc. and it's unclear which files are really being used There are multiple includes in each file to files that include other files that include other files, etc. There have been a multiple developers on the project that each had there own way of doing things. For

Possible to condense primary key/serial?

半城伤御伤魂 提交于 2019-12-02 03:55:03
问题 I have a database where everything is linked with foreign keys, so the Postgres knows exactly how the database is layed out.. Well, Lets say I have Table1 and Table2. Table1 has 3 fields. RID, table2_rid,data So table1.table2_rid references table2.RID and this is expressed with a foreign key. In both the RID field is the primary key and is a serial type. What I would like to know is how to "condense" the primary keys? Like say you add 5 records and deleted record number 3. Your primary keys

Possible to condense primary key/serial?

本小妞迷上赌 提交于 2019-12-01 23:19:57
I have a database where everything is linked with foreign keys, so the Postgres knows exactly how the database is layed out.. Well, Lets say I have Table1 and Table2. Table1 has 3 fields. RID, table2_rid,data So table1.table2_rid references table2.RID and this is expressed with a foreign key. In both the RID field is the primary key and is a serial type. What I would like to know is how to "condense" the primary keys? Like say you add 5 records and deleted record number 3. Your primary keys would look like 1 2 4 5 Well, how do I get to update everywhere so that the primary key(and

Resources (resx) maintenance in big projects

旧巷老猫 提交于 2019-11-30 14:15:59
问题 In a big project where you have lots of resources (resx) what would be the right approaches and/or tools of translation in order to save time, at the same time keep everything in order and leave nothing behind. More precisely, how to find (as far as translations are concerned) what has been modified (adds and removes are easy) of an entire .NET application from a previous version to another? Would resx technology help you there? How? 回答1: I wrote some about it in this answer: Are resx files

Resources (resx) maintenance in big projects

好久不见. 提交于 2019-11-30 09:36:01
In a big project where you have lots of resources (resx) what would be the right approaches and/or tools of translation in order to save time, at the same time keep everything in order and leave nothing behind. More precisely, how to find (as far as translations are concerned) what has been modified (adds and removes are easy) of an entire .NET application from a previous version to another? Would resx technology help you there? How? Stefan Steinegger I wrote some about it in this answer: Are resx files suitable for Internationalization? Summary: You should use a localization tool. It notices