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:
function replaceSearchParam(href,param,value){
	var url=new URL(href);
	var search_params=url.searchParams;
	search_params.set(param,value);
	url.search=search_params.toString();
	var new_url=url.toString();
	return new_url;
}
$('.catalog .item .time input').on('change',function(){
	var id=$(this).closest('.values').find('input:checked').val();
	var buy_link=$(this).closest('.item').find('.buy a')
	buy_link.attr('href',replaceSearchParam(buy_link.attr('href'),'m',id));
});
Categories: Javascript Tags:
function current_time(){
	let bangkok_datetime_str=new Date().toLocaleString("en-US",{timeZone:"Asia/Bangkok"});
	var date=new Date(bangkok_datetime_str);
	var hours=date.getHours();
	var minutes=date.getMinutes();
	var seconds=date.getSeconds();
	if(hours<10)hours="0"+hours;
	if(minutes<10)minutes="0"+minutes;
	if(seconds<10)seconds="0"+seconds;
	document.getElementById('current_time').innerHTML='<span class="number">'+hours+'</span><span class="dot">:</span><span class="number">'+minutes+'</span><span class="dot">:</span><span class="number">'+seconds+'</span>';
}
$(document).ready(function(){
	setInterval(current_time,1000);
});
<div id="current_time"></div>
Categories: Javascript Tags: