maintenance

Rails: Display Maintenance Page if No Database Connection Available

ε祈祈猫儿з 提交于 2019-12-04 18:45:57
I'm looking for a solution that will allow my rails app to render a user-friendly maintenance page when there is no Mysql server available to connect to. Normally a Mysql::Error is thrown from the mysql connection adapter in active_record Something like: /!\ FAILSAFE /!\ Wed May 26 11:40:14 -0700 2010 Status: 500 Internal Server Error Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock Is there a low-overhead way to catch this error and render a maintenance page instead? I'm assuming that since connections are actually made in the active_record mysql adapter the app

ZF2 maintenance page

﹥>﹥吖頭↗ 提交于 2019-12-04 17:13:51
I try to set up a maintenance page with ZF2 but it's not working. I put a maintenance.html page in public folder (www) and in my onbootstrap function I've got the following code : $config = $e->getApplication()->getServiceManager()->get('Appli\Config'); if($config['maintenance']) { $response = $e->getResponse(); $response->getHeaders()->addHeaderLine('Location', '/maintenance.html'); $response->setStatusCode(503); return $response; } I enter the if cause $config['maintenance'] is true but it's not displaying my maintenance.html page as expected. Instead it displays the page asked. Is there

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

自作多情 提交于 2019-12-04 07:27:03
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . 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

Rewrite of legacy code [closed]

こ雲淡風輕ζ 提交于 2019-12-03 18:40:32
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . My department is currently faced with the responsibility for the task of maintaining a rather large COBOL code base. We are wondering how to add new features to keep up with business needs. COBOL programmers are hard to come by these days, and we also think we would get

Tips for cleaning and maintaining a big css file

拥有回忆 提交于 2019-12-03 12:50:43
I just started this new job, where as the designer I have to maintain the CSS file for our web app. Right now it spans almost 7000 lines, weights over 160kb and has hundreds of !important rules. I would like to reorganize the file, split it into sub sections, clean it, and homogenize its syntax. But it seems like a huge undertaking and the file and the app are so big and complex that I wonder if it is even doable without breaking something (and not seeing it). I have audited the file using online tools, and it seems I can use some sort of automated refactoring without risking too much. I have

I'm maintaining a Java class that's 40K lines long.. problem?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 11:04:21
问题 This may be a subjective question leading to deletion but I would really like some feedback. Recently, I moved to another very large enterprise project where I work as a developer. I was aghast to find most classes in the project are anywhere from 8K to 50K lines long with methods that are 1K to 8K lines long. It's mostly business logic dealing with DB tables and data management, full of conditional statements to handle the use cases. Are classes this large common in large enterprise systems?

nginx maintenance page with content issue

自作多情 提交于 2019-12-03 07:58:46
问题 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",

Check when password was last changed

给你一囗甜甜゛ 提交于 2019-12-03 05:59:39
问题 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? 回答1: 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" 回答2: * nix Check out the command chage or getprpw Windows net user UserName has the information in it 回答3: net user UserName /DOMAIN | find /I

Coding Priorities: Performance, Maintainability, Reusability?

被刻印的时光 ゝ 提交于 2019-12-03 03:13:44
This came about mainly due to answers to SQL questions. UDF's and Sub Queries are intentionally omitted because of performance. I didn't include reliability not that it should be taken for granted, but the code has to work. Does performance always come first? So many answers are provided with performance as the main priority. My users seem to be more concerned with how quickly the code can be modified. So a report takes 15 seconds instead of 12 to run. They can live with that as long as I'm not making excuses for not providing solutions. Obviously if the 15 seconds turns into 15 minutes, there

I'm maintaining a Java class that's 40K lines long.. problem?

北城以北 提交于 2019-12-03 02:38:45
This may be a subjective question leading to deletion but I would really like some feedback. Recently, I moved to another very large enterprise project where I work as a developer. I was aghast to find most classes in the project are anywhere from 8K to 50K lines long with methods that are 1K to 8K lines long. It's mostly business logic dealing with DB tables and data management, full of conditional statements to handle the use cases. Are classes this large common in large enterprise systems? I realize without looking at the code it's hard to make a determination, but have you ever worked on a