This file contains hidden or 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
// restore | |
gunzip < [dump_file].sql.gz | mysql -u[uname] -p[pass] [target_dbname] | |
mysql -u[uname] -p[pass] [target_dbname] < [dump_file].sql | |
// dump | |
mysqldump -u[uname] -p[pass] [dbname] > [dump_file].sql | |
mysqldump -u[uname] -p[pass] [dbname] | gzip -9 > [bump_file].sql.gz | |
// dump from remote server to local | |
ssh -C [user]@[remote_host] "mysqldump --opt --compress -u[uname] -p[pass] [database_name] | gzip -9 -c" > dump.sql.gz |
This file contains hidden or 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
sudo apt-get update | |
sudo apt-get install git mercurial openssl libssl-dev libxslt1-dev libxml2-dev nginx build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev | |
sudo mkdir /etc/nginx/ssl | |
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt | |
# Add to enabled sites config to server conf. | |
listen 443 ssl; | |
ssl_certificate /etc/nginx/ssl/nginx.crt; | |
ssl_certificate_key /etc/nginx/ssl/nginx.key; |
This file contains hidden or 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
a = archive - means it preserves permissions (owners, groups), times, symbolic links, and devices. | |
r = recursive - means it copies directories and sub directories | |
v = verbose - means that it prints on the screen what is being copied | |
z = compress - compress file data during the transfer | |
rsync -arvz --exclude="*.log" --exclude="*.gz" [email protected]:/var/www/site.home ./ | |
// it's create new 'site.home' folder in current dir. |
This file contains hidden or 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
grep -rl --include="*.php" "old_word" ./ | xargs sed -i 's/old_word/new_word/g' | |
// grep with OR condition and sort result | |
grep 'foo\|bar' | sort |
This file contains hidden or 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
Даниил | |
добрый день , не желаете начать зарабатывать в интернете до 2.000 $ за 2 недели ? | |
Максим | |
желаю | |
Даниил | |
Для этого вам нужно каждый день в течении двух недель делать инвестирование вложение в проект Игрик от 5000 рублей | |
В последующие 2 недели доходы будут увеличиваться с отдачей процентов в течении 2 недель |
This file contains hidden or 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 | |
SITEPATH=./some-site.home | |
SITEURL=some-site.home | |
SITETITLE=some-site | |
DBHOST=localhost | |
DBNAME=somesitedb | |
DBUSER=root | |
DBPASS=root |
This file contains hidden or 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
module Converter | |
PRIORITIES = {')' => 0, '(' => 0, '+' => 1, '-' => 1, '*' => 2, '/' => 3 } | |
module_function | |
def polish(inp_exp) | |
res = [] | |
stack = [] | |
exp = inp_exp.scan(/\d+|\(|\)|\+|\-|\*|\//) | |
exp.each do |e| |
This file contains hidden or 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
Sidebar Enhancements | |
https://github.com/titoBouzout/SideBarEnhancements | |
Добавляет полезные фичи в Сайд бар |
This file contains hidden or 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
def next_str(str) | |
counter = 1 | |
res = '' | |
arr = str.split('') | |
arr.each_with_index do |current_ch, i| | |
next_ch = arr.fetch(i + 1, nil) | |
counter += 1 and next if current_ch == next_ch |
This file contains hidden or 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
== Install rvm and ruby == | |
# rvm - менеджер версий руби (можно устанавливать разные версии и переключать их для каждого проекта индивидуально) | |
# see: https://rvm.io/ | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB | |
curl -sSL https://get.rvm.io | bash -s stable --ruby | |
# Установка конкретной версии рубей see: https://rvm.io/rubies/installing | |
rvm install 2.1.1 | |
rvm --default use 2.1.1 |
OlderNewer