Skip to content

Instantly share code, notes, and snippets.

View zillingen's full-sized avatar

Dmitry Zakharov zillingen

  • Russia, Moscow
View GitHub Profile
/*Прокрутка страницы к заданному элементу*/
$("#button").click(function() {
$('html, body').animate({
scrollTop: $("#myDiv").offset().top
}, 2000);
});

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

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

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

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

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

show interface ip brief

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
@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\$'
<?php
/*----------------------------------------
| Инструкции и примеры по работе с PDO |
----------------------------------------*/
/**
* Подключение к базе данных
*/
try {
$db = new PDO('mysql:host=localhost;dbname=database;charset=UTF8','user','password');
@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 = 'привет';

Работа с Git

Создание локального репозитория

git init

Настройка User Name and User Email

git config --global user.name "admin"
@zillingen
zillingen / NPM_behind_proxy_in_Windows.md
Last active December 13, 2024 19:04
How to setup npm proxy settings behind proxy on Windows

Setup npm behind HTTP and HTTPS proxy on Windows

How to setup npm proxy settings behind HTTP and HTTPS proxy on Windows

Create .npmrc in home dir

In your user home dir create file .npmrc with your username and password:

proxy = http://user:[email protected]:8080
@zillingen
zillingen / mysqldump.md
Last active November 3, 2017 19:50
Backup and restore MySQL database with mysqldump

Backup and restore MySQL database with mysqldump

Create database dump:

mysqldump -uroot database_name > dump.sql

Restore database dump to mysql: