Архив

Архив Июнь 2023
grep "/test/" ./log.log | cut -d ' ' -f 1 | sort | uniq -c | sort -n | tail -n 30

Источник: https://habr.com/ru/articles/236771/

Categories: Linux Tags:

отправить тело запроса в get запросе используя curl

$timeout=5;
$auth=array(
	'WebApiSession: '.$WebApiSession,
);
$curl=curl_init();
curl_setopt($curl,CURLOPT_CONNECTTIMEOUT,$timeout);
curl_setopt($curl,CURLOPT_TIMEOUT,$timeout);
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_HEADER,0);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl,CURLOPT_HTTPHEADER,$auth);
curl_setopt($curl,CURLOPT_CUSTOMREQUEST,'GET');
curl_setopt($curl,CURLOPT_POSTFIELDS,$booking_data);
$result=curl_exec($curl);
Categories: PHP Tags:
$(document).ready(function(){
	setTimeout(function(){
		$.cookie('nf_timeout',true,{
			expires:1,
			path:'/'
		});
	},30000);
	if($.cookie('nf_timeout')&&!$.cookie('nf_popup')){
		$(document).mouseleave(function(e){
			if((e.clientY<10)&&!($("#nf_link").hasClass("clicked"))){
				setTimeout(function(){
					$("#nf_link").addClass('clicked').click();
				},1);
				$.cookie('nf_popup',true,{
					expires:7,
					path:'/'
				});
			}
		});
	};
});
<a href="<?=$r_nf['popup_link']?>" class="popup fancybox.ajax" id="nf_link"><?=$r_nf['name']?></a>

Необходима библиотека https://yandex.st/jquery/cookie/1.0/jquery.cookie.min.js

Categories: Javascript Tags:
function replaceQueryParam(param,newval,search){
	var regex=new RegExp("([?;&])"+param+"[^&;]*[;&]?");
	var query=search.replace(regex,"$1").replace(/&$/,'');
	return (query.length>2?query+"&":"?")+(newval?param+"="+newval:'');
}
var next_page=2;
var search_param=location.search;
search_param=replaceQueryParam('page',next_page,search_param);
var newurl=window.location.pathname+search_param;
window.history.pushState({path:newurl},'',newurl);
Categories: Javascript Tags:
iptables -A INPUT -s 192.168.10.10 -j DROP
Categories: Linux Tags: