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
#!/bin/bash | |
# Add vbox repo | |
bash -c 'echo "deb https://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list' | |
# Add key certificates | |
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | apt-key add - | |
# Install vbox | |
apt-get update | |
apt-get install virtualbox-5.2 | |
apt-get install dkms |
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
#!/bin/bash | |
# Example invocation | |
# ./scp.sh test_file.tar.gz ub@192.168.0.1 ub@10.0.0.2:~ | |
FILE=$1 | |
INTERMEDIATE_HOST=$2 | |
END_HOST=$3 | |
scp -oProxyCommand="ssh -W %h:%p $INTERMEDIATE_HOST" $FILE $END_HOST |
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
# From https://www.hiroom2.com/2016/05/18/ubuntu-16-04-auto-apt-update-and-apt-upgrade/ | |
# Fix dpkg error in ubuntu 16 | |
sudo systemctl disable apt-daily.service # disable run when system boot | |
sudo systemctl disable apt-daily.timer # disable timer run |
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
#!/bin/bash | |
# From https://gist.github.com/earthgecko/3089509 | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 12 | head -n 1 |
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
# Edit ~/.ssh/config | |
# As an example, your config file could look like this: | |
Host database | |
HostName <real IP address or hostname here> | |
User username | |
# Then you can type ssh database on the command line and ssh will automatically do ssh username@ip.address for you. |
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
# Why not dind -> https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/ | |
# Instead of starting “child” containers, this will start “sibling” containers. | |
docker run -v /var/run/docker.sock:/var/run/docker.sock ... |
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
# Find out what package install the binary that you want | |
yum whatprovides *bin/rpmbuild* # --> We wnat to install rpmbuild |
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
# Find system version | |
lsb_release -a | |
# Find installed package version | |
dpkg -s <packagename> | |
# Find available package versions | |
apt-cache policy <packageName> | |
# Create intermediate folders |
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
#!/bin/bash | |
# Removes docker containers then docker images and lastly clears cache | |
# From https://github.com/docker/docker/issues/928 | |
docker rm $(docker ps -a -q) && docker rmi $(docker images -q) && docker ps -a | cut -c-12 | xargs docker rm |
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
git remote add upstream $REMOTE_REPOSITORY | |
git fetch upstream | |
git merge upstream/$BRANCH_TO_MERGE |
NewerOlder