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 | |
# Reads a file line-by-line and applies regex with two groups and checks if left string is present in right string | |
regex="([0-9]{10})#PHVN(.*)" | |
while IFS="" read -r p || [ -n "$p" ] | |
do | |
line=$(printf '%s\n' "$p") | |
if [[ $line =~ $regex ]] | |
then |
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 | |
curl -L "https://github.com/docker/compose/releases/download/1.8.1/docker-compose-$(uname -s)-$(uname -m)" > /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose | |
docker-compose --version |
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 nano /etc/init.d/StartVM && sudo chmod +x /etc/init.d/StartVM && sudo update-rc.d StartVM defaults 99 01 | |
#! /bin/sh | |
# Start VirtualBox @boot | |
# /etc/init.d/StartVM | |
# | |
#Edit these variables! | |
VMUSER=user | |
VMNAME=VM1 |
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 | |
apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get purge -y && apt-get autoremove -y | |
apt-get install dbus nano htop openssh-server | |
reboot now |
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 install openssh-server -y | |
mkdir ~/.ssh | |
mkdir /home/gergely/.ssh | |
cat id_rsa.pub >> /home/gergely/.ssh/authorized_keys | |
sudo nano /etc/ssh/sshd_config | |
sudo service ssh reload | |
sudo service ssh restart | |
cp Desktop/id_rsa .ssh/id_rsa | |
chmod 400 ~/.ssh/id_rsa |
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 | |
docker rm -v $(docker ps --filter status=exited -q 2>/dev/null) 2>/dev/null | |
docker rmi $(docker images --filter dangling=true -q 2>/dev/null) 2>/dev/null |
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 | |
mkdir /etc/systemd/system/docker.service.d | |
echo "[Service]" > /etc/systemd/system/docker.service.d/docker.conf | |
echo "ExecStart=" >> /etc/systemd/system/docker.service.d/docker.conf | |
echo "ExecStart=/usr/bin/docker daemon -H fd:// --insecure-registry gitlab.dev.nts:6000 -H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock" >> /etc/systemd/system/docker.service.d/docker.conf | |
systemctl daemon-reload | |
service docker stop | |
service docker start | |
echo "Done! On error run journalctl " |
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 | |
# Stop All containers | |
docker stop $(docker ps -a -q) | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
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
#!/usr/bin/env bash | |
sudo apt-get update && apt-get -y upgrade && apt-get autoremove && apt-get clean | |
v=$(uname -r) | |
apt-get install -y apt-transport-https ca-certificates | |
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" > /etc/apt/sources.list.d/docker.list | |
apt-get update | |
apt-get purge lxc-docker | |
apt-cache policy docker-engine | |
apt-get update |