Skip to content

Instantly share code, notes, and snippets.

View michaelradionov's full-sized avatar

Michael Radionov michaelradionov

View GitHub Profile
wprehost(){
#!/bin/bash
set -e
# Ищем wp-config.php
if [ -f wp-config.php ]; then
echo "Нашел wp-config.php в текущей директории!"
CONF=wp-config.php
else
if [ -f ../wp-config.php ]; then
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@michaelradionov
michaelradionov / sizes.sql
Created April 29, 2019 14:44
SQL tables sizes
SELECT TABLE_NAME, table_rows, data_length, index_length, round(((data_length + index_length) / 1024 / 1024),2) "Size in MB" FROM information_schema.TABLES WHERE table_schema = "bsgswoo" ORDER BY (data_length + index_length) DESC;
curl https://gist.githubusercontent.com/michaelradionov/84879dc686e7f9e43bc38ecbbd879af4/raw/17f942d078b5b2202dd12eab9a5c4d55b4a06259/Docker_Ubuntu_16.sh | sudo bash
curl -L https://iterm2.com/shell_integration/install_shell_integration.sh | bash
eval "$(curl "https://raw.githubusercontent.com/michaelradionov/gg_installer/master/gg_installer.sh")" && gg_installer bdsm
bdsm --install-all
@michaelradionov
michaelradionov / Docker_Ubuntu_16.sh
Last active July 14, 2020 06:52
Installation of Docker on Ubuntu 16.04
# Repo
apt-get update;
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common;
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -;
apt-key fingerprint 0EBFCD88;
@michaelradionov
michaelradionov / Laravel 5.7 SVG
Created November 4, 2018 04:29
Little bash script to download fancy Laravel SVG's to your project when updating to 5.7
mkdir -p public/svg; \
cd public/svg; \
curl -O https://raw.githubusercontent.com/laravel-shift/laravel-5.7/master/public/svg/403.svg; \
curl -O https://raw.githubusercontent.com/laravel-shift/laravel-5.7/master/public/svg/404.svg; \
curl -O https://raw.githubusercontent.com/laravel-shift/laravel-5.7/master/public/svg/500.svg; \
curl -O https://raw.githubusercontent.com/laravel-shift/laravel-5.7/master/public/svg/503.svg; \
cd ../..;
@michaelradionov
michaelradionov / Makefile
Created October 28, 2018 16:44
Makefile
#!/usr/bin/make
# Makefile readme (ru): <http://linux.yaroslavl.ru/docs/prog/gnu_make_3-79_russian_manual.html>
# Makefile readme (en): <https://www.gnu.org/software/make/manual/html_node/index.html#SEC_Contents>
SHELL = /bin/sh
REGISTRY_HOST = registry.gitlab.com
REGISTRY_PATH = tarampampam/laravel-in-docker/
IMAGES_PREFIX := $(shell basename $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
export EDITOR='micro'
export CHEAT_EDITOR='micro'
export PATH="$HOME/.composer/vendor/bin:$PATH"
export PATH="vendor/bin:$PATH"
export PATH="/usr/local/bin:$PATH"
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
export HISTTIMEFORMAT="%d/%m/%y %T "
# Other aliases
alias la='ls -alh'
alias hosts='cat ~/.ssh/config' # я храню хосты в этом файле. это позволяет подключаться к ним вот так ssh 47
alias passgen='openssl rand -base64 6' #сгенерировать пароль
alias genpass='passgen' # я тупой
alias b='m ~/.bashrc'
alias m='micro'
alias atom='atom -a'
alias code='code -a'
alias p='pstorm'