> cat ifcfg-eth0
DOMAIN=localhost
> export DOMAIN=local.lan && sed -i '' -e "s|DOMAIN=.*$|DOMAIN=$DOMAIN|" ifcfg-eth0
> cat ifcfg-eth0
DOMAIN=local.lan
<?php
header('Access-Control-Allow-Origin: *');
echo $_SERVER['REMOTE_ADDR'];
php -S 127.0.0.1:8080
DROP PROCEDURE IF EXISTS t1;
DELIMITER //
CREATE PROCEDURE t1 ()
BEGIN
DECLARE e, w, s, n INT;
SELECT 1 INTO e;
SELECT 2 INTO w;
SELECT 3 INTO s;
SELECT 4 INTO n;
SET e = w = s = n = NULL;
SELECT e,w,s,n;
END//
DELIMITER ;
DROP PROCEDURE IF EXISTS t2;
DELIMITER //
CREATE PROCEDURE t2 ()
BEGIN
DECLARE e, w, s, n INT;
SELECT 1 INTO e;
SELECT 2 INTO w;
SELECT 3 INTO s;
SELECT 4 INTO n;
SET e = NULL;
SET w = NULL;
SET s = NULL;
SET n = NULL;
SELECT e,w,s,n;
END//
DELIMITER ;
CALL t1();
CALL t2();
+------+------+------+------+
| e | w | s | n |
+------+------+------+------+
| NULL | 2 | 3 | 4 |
+------+------+------+------+
+------+------+------+------+
| e | w | s | n |
+------+------+------+------+
| NULL | NULL | NULL | NULL |
+------+------+------+------+
$test->delete;
$test->delete();
function pagination() {
function __construct() {
select * from t;
+-------------------------------------------------------------------------+
| u |
+-------------------------------------------------------------------------+
| [{"name": "Tomas", "user_id": "52"}, {"name": "John", "user_id": "59"}] |
+-------------------------------------------------------------------------+
1 row in set (0.00 sec)
SELECT JSON_EXTRACT(u, REPLACE(REPLACE(JSON_SEARCH(u, 'one', '52'), 'user_id', 'name'), '"', '')) FROM t;
+--------------------------------------------------------------------------------------------+
| JSON_EXTRACT(u, REPLACE(REPLACE(JSON_SEARCH(u, 'one', '52'), 'user_id', 'name'), '"', '')) |
+--------------------------------------------------------------------------------------------+
| "Tomas" |
+--------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
$handle = popen("tail -f /path/to/my/logfile.log 2>&1", 'r');
while(!feof($handle)) {
$buffer = fgets($handle);
// здесь будет вызов API
ob_flush();
flush();
}
pclose($handle);
ALTER IGNORE TABLE <table_name> ADD UNIQUE KEY (<name>,<name>);
Rabbitmq получает список записей
далее к нему обращаются n копий скрипта обработчика, и rabbit выдает запись и убирает из списка задач
'db' => [
.....
'enableSchemaCache' => true,
'schemaCacheDuration' => 3600,
'schemaCache' => 'cache',
]
innodb_flush_method = O_DSYNC
innodb_flush_log_at_trx_commit = 0
<html>
<head></head>
<body>
<button onclick="KeySend()">send ctrl + w</button>
</body>
<script>
function KeyPress(e) {
var evtobj = window.event ? event : e
if (evtobj.keyCode == 87 && evtobj.ctrlKey) alert("Ctrl+w");
}
function KeySend() {
var ke = new KeyboardEvent("keydown", {key: "w", keyCode: 87, ctrlKey: true, cancelable: true, bubbles: true});
document.dispatchEvent(ke);
}
document.onkeydown = KeyPress;
</script>
</html>
<select>
<optgroup label="Группа 1">
<option>Опция 1.1</option>
</optgroup>
<optgroup label="Группа 2">
<option>Опция 2.1</option>
<option>Опция 2.2</option>
</optgroup>
<optgroup label="Группа 3" disabled>
<option>Опция 3.1</option>
<option>Опция 3.2</option>
<option>Опция 3.3</option>
</optgroup>
</select>
tcpdump -i any port 80 -A | grep -A 10 -P '(GET|POST|OPTIONS|PUT|DELETE).*?HTTP/1.[01]' | perl -ne 's/^.*?(?=(GET|POST|OPTIONS|PUT|DELETE))//g; print;'
tcpflow -p -c -i eth0 port 80