This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Image resize with nginx (this is replace phpThumb script) | |
function escapeRegExp(str) { | |
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); | |
} | |
function replaceAll(str, find, replace) { | |
return str.replace(new RegExp(escapeRegExp(find), 'g'), replace); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lsb_release -a | |
No LSB modules are available. | |
Distributor ID: Debian | |
Description: Debian GNU/Linux 8.9 (jessie) | |
Release: 8.9 | |
Codename: jessie | |
Installing telegram-send | |
# pip install telegram-send |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user www-data; | |
worker_processes auto; | |
worker_cpu_affinity auto; | |
worker_rlimit_nofile 10000; | |
worker_shutdown_timeout 30; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 1024; | |
# Для Linux 2.6+ - epool, Для FreeBSD - kqueue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen XX.XX.XX.XX:80; | |
server_name mysite.ru; | |
root /var/www/mysite.ru; | |
index index.php index.html index.htm; | |
error_log /var/log/nginx/mysite.ru_error.log; | |
access_log /var/log/nginx/mysite.ru_access.log main; | |
set $fastcgipass unix:/var/lib/php5-fpm/mysite.sock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SERVER_ADDR=$1 | |
SERVER_PORT=$2 | |
_command_exists() { | |
type "${1}" &> /dev/null | |
} | |
_nc() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MYSITE=torproject.org && openssl s_client -servername ${MYSITE} -connect ${MYSITE}:443 </dev/null 2>/dev/null | openssl x509 -text | sed -n -e '/BEGIN\ CERTIFICATE/,/END\ CERTIFICATE/p' | openssl x509 -fingerprint -sha256 | head -1 | cut -f2 -d'=' | sed 's,:,,g' | tr '[:upper:]' '[:lower:]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
### BEGIN INIT INFO | |
# Provides: proxysql-binlogreader | |
# Required-Start: $local_fs | |
# Required-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: ProxySQL Binlog Reader for MySQL | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- ./frontends/php/include/blocks.inc.php.orig 2019-09-27 20:57:02.214919180 +0300 | |
+++ ./frontends/php/include/blocks.inc.php 2019-09-27 20:57:14.583818457 +0300 | |
@@ -732,7 +732,6 @@ | |
_('Info'), | |
_('Host'), | |
_('Problem'), | |
- $show_opdata ? _('Operational data') : null, | |
_('Duration'), | |
_('Ack'), | |
_('Actions'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -u root -p db_name < dumpfilename.sql > /var/tmp/mysqldump.log 2>&1 | |
or create file mysql-import.sh: | |
#!/bin/bash | |
mysql -u root -p'password' -h hostname db_name << EOF | |
CREATE DATABASE dbname; | |
USE dbname; | |
SET foreign_key_checks=0; | |
SOURCE dbdumpname.sql; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Run: | |
mysql -u root -p db_name < dumpfilename.sql > /var/tmp/mysqldump.log 2>&1 | |
2) Or create file mysql-import.sh: | |
#!/bin/bash | |
mysql -u root -p'password' -h hostname db_name << EOF | |
CREATE DATABASE dbname; | |
USE dbname; | |
SET foreign_key_checks=0; |
OlderNewer