Skip to content

Instantly share code, notes, and snippets.

@antonydevanchi
Last active April 10, 2018 08:28
Show Gist options
  • Save antonydevanchi/bf26c964e621dbd4d55f96a92044f7aa to your computer and use it in GitHub Desktop.
Save antonydevanchi/bf26c964e621dbd4d55f96a92044f7aa to your computer and use it in GitHub Desktop.
# EN: Debian-based shells, but may works with other systems.
# RU: Debian-based скрипты, но может работать и на других системах.
# EN: Get path to folder where placed all installed PHP modules.
# RU: Получить путь до папки где лежат все установленные PHP модули.
php -i | grep extension_dir | sed -n "s/^.*=>\s*\(\S*\)$/\1/p"
# EN: Prestissimo override default Composer installer behavior and will install
all Composer dependencies in parallel. Installation time great reduced.
# RU: Prestissimo переопределяет поведение инсталлятора Composer'а и будет устанавливать
зависимости Composer параллельно. Время установки зависимостей сильно снижается.
# https://github.com/hirak/prestissimo
composer global require "hirak/prestissimo:^0.3" && composer install
# EN: pnpm is a fast implementation of npm install. Installation time great reduced.
# RU: pnpm это более быстрая реализация npm install. Время установки зависимостей сильно снижается.
# https://github.com/pnpm/pnpm
npm install -g pnpm && pnpm install
# RU: Ускоряет composer за счёт увеличенного размера кэша
composer config --global cache-files-maxsize "2048MiB"
# RU: Ускоряет Laravel / Artisan за счёт наличия кэшэй
php artisan optimize
php artisan config:cache
php artisan route:cache
# Помещает все файлы заданного размера в .gitignore
find . -size +1G | cat >> .gitignore
# Позволяет наглядно оценить траффик вашего ElasticSearch
tcpdump -A -nn -s 0 'tcp dst port 9200 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -i lo
# Генерация рандомного пароля
openssl rand -base64 24
# Полнотекстовый поиск по файлам
grep -rnw '/path/to/target' -e "text to search"
# Остановка и удаление всех доступных на хосте контейнеров Докера
docker rm -f $(docker ps -a | awk '{print $1}' | grep -v CONTAINER)
# Установка java на OS X
brew cask install java
# Генерация 32-ух случайных альфанабмер аппер,лоуркейс символов
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment