Skip to content

Instantly share code, notes, and snippets.

View pinguinens's full-sized avatar

Nikolay pinguinens

View GitHub Profile
@pinguinens
pinguinens / rebuildContainer.sh
Created February 10, 2019 12:40
Bash: fast rebuilding Docker container without using cache and starting up it
#!/bin/bash
docker-compose build --no-cache \
&& docker-compose up
@pinguinens
pinguinens / createNetwork.sh
Last active February 10, 2019 12:37
Bash: fast creation Docker bridge network
#!/bin/bash
docker network create --attachable -d bridge dockernet
@pinguinens
pinguinens / installDocker.sh
Created February 10, 2019 12:35
Bash: fast installation Docker and Docker-compose
#!/bin/bash
sudo apt-get update \
&& sudo 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 - \
&& sudo add-apt-repository \
@pinguinens
pinguinens / addUser.sh
Created February 10, 2019 12:34
Bash: fast creating new sudoer user
#!/bin/bash
useradd docker -s /bin/bash -m \
&& passwd NEWUSER
usermod -a -G sudo NEWUSER
@pinguinens
pinguinens / setSwap.sh
Last active February 10, 2019 12:33
Bash: fast setting swap
#!/bin/bash
swapoff -a \
&& fallocate -l 2G /swapfile \
&& ls -lh /swapfile \
&& chmod 600 /swapfile \
&& mkswap /swapfile \
&& echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab \
&& swapon -a \
&& echo 'Swapfile was configured'