Skip to content

Instantly share code, notes, and snippets.

View zillingen's full-sized avatar

Dmitry Zakharov zillingen

  • Russia, Moscow
View GitHub Profile
@zillingen
zillingen / php-all.php
Last active December 25, 2017 08:40
PHP все подряд
<?php
// Show Errors
error_reporting(E_ALL);
ini_set("display_errors", 1);
/**
* Cyrillic to Latin transliteration via PHP Transliterator class
*/
$rus = 'привет';
<?php
/*----------------------------------------
| Инструкции и примеры по работе с PDO |
----------------------------------------*/
/**
* Подключение к базе данных
*/
try {
$db = new PDO('mysql:host=localhost;dbname=database;charset=UTF8','user','password');
@zillingen
zillingen / linux.md
Last active August 12, 2018 16:21
Linux configuration and administration

Env configuration

# PS1 with red username (for root)
PS1='\e[0;31m\]\u\e[0m\]@\h:\w\$'

# PS1 with green username (for base user)
PS1='\e[0;32m\]\u\e[0m\]@\h:\w\$'

Cisco routers recipies

System

Backup config to FTP server and print CLI commands in syslog

archive
 log config
  logging enable
  notify syslog contenttype plaintext
 hidekeys

Рецепты для Cisco ASA

Версий 8.4 и старше

Базовые команды

Список интерфейсов и ip-адресов:

show interface ip brief

Recipies for Apache and .htaccess

Show PHP errors based on .htaccess file for directory

php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_flag  log_errors on
php_value error_log /home/path/public_html/domain/PHP_errors.log
/*Прокрутка страницы к заданному элементу*/
$("#button").click(function() {
$('html, body').animate({
scrollTop: $("#myDiv").offset().top
}, 2000);
});