-Поиск по дневнику

Поиск сообщений в rss_thedaily_wtf

 -Подписка по e-mail

 

 -Постоянные читатели

 -Статистика

Статистика LiveInternet.ru: показано количество хитов и посетителей
Создан: 06.04.2008
Записей:
Комментариев:
Написано: 0


CodeSOD: An Interesting Way to Find Even

Понедельник, 24 Ноября 2014 г. 14:00 + в цитатник

While combing the server logs for clues as to what might have caused the latest incident in staging, Steve was startled to find that the box he was looking at hadn't logged anything for months.

Was logging disabled? No, it all looked fine. He accessed the box directly and the site came right up, complete with an entry in the access logs. So where were the logs for the past three months?

On a hunch, he checked the proxy.pac:


function FindProxyForURL(url, host) {
	var myip=myIpAddress(); 
	var ipbits=myip.split("."); 
	var myseg=parseInt(ipbits[3]); 
	if(myseg==Math.floor(myseg/2)*2){ 
		return "PROXY 172.28.97.17:8080; PROXY 172.28.97.18:8080; DIRECT"; 
	} 
	else { 
		return "PROXY 172.28.97.17:8080; PROXY 172.28.97.18:8080; DIRECT"; 
	} 
}

Not only was the file missing the third staging server, but every calculation was redundant since it always returned the same string. He replaced it with a one-liner, added the third server, and tossed another item onto the ever-growing backlog of technical debt to look into someday. Someday...

Photo credit: creativegaz / Foter / CC BY

http://thedailywtf.com/articles/an-interesting-way-to-find-even

Метки:  

 

Добавить комментарий:
Текст комментария: смайлики

Проверка орфографии: (найти ошибки)

Прикрепить картинку:

 Переводить URL в ссылку
 Подписаться на комментарии
 Подписать картинку