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
start = new Date().getTime(); | |
for ( n = 0; n < maxCount; n++ ) { | |
/* measuringFunction(); */ | |
}; | |
elapsed = new Date().getTime() - start; | |
alert("Measured time: " + elapsed); |
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
-- *************************************** | |
-- По урокам LoftBlog + моя информация. Уроки LoftBlog содержат инструкции по работе с SQlite, MySQL, PostgreSQL. | |
-- Тут только postgres | |
-- *************************************** | |
-- *************************************** | |
-- введение | |
-- http://loftblog.ru/material/1-vvedenie/ | |
-- *************************************** |
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
COUNT(X) - количество величин аргумента Х, со значением не равным NULL | |
SUM(X) - сумма величин в аргументе Х | |
MIN(X) - минимум Х | |
MAX(X) - возвращает максимум Х | |
ROUND(X) - возвращает Х округленный до ближайшего целого | |
RANDOM() - возвращает случайную величину от 0 до 1 | |
LENGTH(X) - длина строки Х | |
TRIM(X) - удаляет пробелы в начале и конце строки | |
LOWER(X) - приводит строку к нижн регистру |
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
psql создан как «консольное приложение». Поскольку в Windows консольные окна используют | |
кодировку символов отличную от той, что используется для остальной системы, нужно проявить | |
особую осторожность при использовании 8-битных символов. Если psql обнаружит проблемную | |
кодовую страницу консоли, он предупредит вас при запуске. Чтобы изменить кодовую страницу | |
консоли, необходимы две вещи: | |
• Задать кодовую страницу, выполнив cmd.exe /c chcp 1251. (1251 это кодовая страница для | |
России, замените на ваше значение.) При использовании Cygwin, эту команду можно записать | |
в /etc/profile. | |
• Установите консольный шрифт в Lucida Console, потому что растровый шрифт не работает с | |
кодовой страницей ANSI. |
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
редактировать | |
crontab -e | |
логи | |
/var/log/syslol |
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
Вывести всех пользователей | |
SELECT * FROM pg_shadow; | |
Поменять пароль пользователю | |
ALTER USER "user_name" WITH PASSWORD 'new_password'; | |
командой psql | |
\password user_name | |
Переименовать пользователя постгрес | |
ALTER USER <old_username> RENAME TO <new_username>; |
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
Большая шпора по командам | |
http://help.ubuntu.ru/wiki/%D0%BA%D0%BE%D0%BC%D0%B0%D0%BD%D0%B4%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D1%80%D0%BE%D0%BA%D0%B0 | |
ps -la // Для получения основных сведений о процессах, запущенных текущем пользователем | |
ps -ela // Для всех пользователей | |
ps -a // Базовая информация для текущего пользователя | |
top – команда выдачи данных об активности процессов в Ubuntu | |
w – определяем, кто зарегистрирован и что они делают |
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
Ссылки | |
http://help.ubuntu.ru/wiki/%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D0%B8_%D0%B8_%D0%B3%D1%80%D1%83%D0%BF%D0%BF%D1%8B | |
https://losst.ru/kak-posmotret-spisok-polzovatelej-v-ubuntu | |
Работа с пользователями | |
Поменять пользователя | |
su - anotheruser | |
Список пользователей |
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
https://habrahabr.ru/post/122445/ |
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: Копируем файл «file.txt» из удаленного сервера на локальный компьютер. | |
$ scp user@remote.host:file.txt /some/local/directory | |
Пример 2: Копируем файл «file.txt» с локального компьютера на удаленный сервер. | |
$ scp file.txt user@remote.host:/some/remote/directory | |
Пример 3: Копируем папку «dir1» с локального хоста в директорию «dir2» на удаленном хосте. | |
$ scp -r dir1 user@remote.host:/some/remote/directory/dir2 | |
больше тут: |
OlderNewer