Skip to content

Instantly share code, notes, and snippets.

View mikepsinn's full-sized avatar
💭
Attaining universal consciousness

Mike P. Sinn mikepsinn

💭
Attaining universal consciousness
View GitHub Profile
#!/bin/bash
echo "You can run from a gist using:"
echo "curl https://gist.github.com/mikepsinn/c556646c70c4a3ec71c5b057eeab75e6/raw/147dc4386f8cc0c6a47e450997f4821e07845ceb/mysql_create_user.sh | bash -s ROOT_PASSWORD NEW_USER_PASSWORD"
if [ ! -f ~/.my.cnf ];
then
echo "ERROR: Please create ~/.my.cnf containing:"
echo "[client]"
echo "password=your_pass"
exit 1
else
Package the pre-configured box =>
vagrant package --base preconfigured_vm --output /path/to/qm-ubuntu-slave-vagrant-package.box
i.e. vagrant package --base QM-Docker_default_1515955669346_6871 --output K:\Development\qm-ubuntu-slave-vagrant-package.box
Note that as per the docs, the --base option should be the UUID of the machine,
or the name VirtualBox gives the machine (found when opening the VirtualBox application).
Transfer the box to the computer by using scp, rsync or whatever...
(you also start a web server quickly by using python -m http.server PORT or ruby -run -e httpd /path/to -p PORT)
#!/usr/bin/env bash
# curl https://gist.githubusercontent.com/mikepsinn/453c8ee2fa58515aa90b5b52c63451e5/raw/mysql_uninstall.sh | bash -s
echo "INSTALLED MYSQL PACKAGES"
sudo dpkg -l | grep mysql
sudo apt-get remove -y --purge libdbd-mysql-perl libmysqlclient18:amd64 mysql-client-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5 mysql-client-core-5.5
sudo apt-get autoremove -y
sudo apt-get autoclean -y
sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql
#!/usr/bin/env bash
# curl https://gist.githubusercontent.com/mikepsinn/57171acd32c8eb915d3c7fe7735dd28e/raw/dropbox_auto_start.sh | bash -s
if ((${EUID:-0} || "$(id -u)")); then
echo "Good, you are not root. Continuing..."
else
echo "Do not run as root"
exit 1
fi
#!/usr/bin/env bash
# curl https://gist.githubusercontent.com/mikepsinn/1fe8b50d91ff403cae5745da0b9f2b68/raw/dropbox_install.sh | bash -s
sudo su
su jenkins
cd ~
curl -Lo dropbox-linux-x86_64.tar.gz https://www.dropbox.com/download?plat=lnx.x86_64
sudo mkdir -p /opt/dropbox
sudo tar xzfv dropbox-linux-x86_64.tar.gz --strip 1 -C /opt/dropbox
#!/usr/bin/env bash
# curl https://gist.githubusercontent.com/mikepsinn/00a4153544a31bb6c645da13e4a9a26e/raw/git_config.sh | bash -s ${GITHUB_ACCESS_TOKEN}
echo "Using GITHUB_ACCESS_TOKEN $1"
GITHUB_ACCESS_TOKEN=$1
if [ -z ${GITHUB_ACCESS_TOKEN} ]; then
echo "GITHUB_ACCESS_TOKEN not set!"
exit 1
fi
#!/usr/bin/env bash
# curl https://gist.githubusercontent.com/mikepsinn/34b93aaf8172140c44b3146dfdbcf7e2/raw/pre_deploy_web_jenkins.sh | bash -s ${GITHUB_ACCESS_TOKEN}
if [ -z ${GIT_COMMIT} ]; then
echo "GIT_COMMIT not set!"
exit 1
fi
echo "Using GITHUB_ACCESS_TOKEN $1"
GITHUB_ACCESS_TOKEN=$1
#!/usr/bin/env bash
# curl https://gist.githubusercontent.com/mikepsinn/537442a7622aca29b905bcfd95e01650/raw/jenkins_install.sh | bash -s
curl https://gist.githubusercontent.com/mikepsinn/99a12d7b51322d184d3033c929dc4550/raw/java_8_install.sh | bash -s
#echo "=== sudo service jenkins stop ==="
#sudo service jenkins stop
#echo "=== sudo apt-get remove --purge jenkins || true ==="
#sudo apt-get remove --purge jenkins || true
#!/usr/bin/env bash
# curl https://gist.githubusercontent.com/mikepsinn/99a12d7b51322d184d3033c929dc4550/raw/java_8_install.sh | bash -s
########################
# System up to date
########################
echo "apt-get update..." && sudo apt-get update >/dev/null
#sudo apt-get upgrade -y
#!/usr/bin/env bash
# curl https://gist.githubusercontent.com/mikepsinn/5cb519ccf9cfc7db00cc7927ed04f78a/raw/jenkins_restore_entire_folder.sh | bash -s ${GITHUB_ACCESS_TOKEN}
echo "Using GITHUB_ACCESS_TOKEN $1"
GITHUB_ACCESS_TOKEN=$1
curl https://gist.githubusercontent.com/mikepsinn/8421e183244ff02564e15b355e382cbc/raw/clone_jenkins_backup_repo.sh | bash -s ${GITHUB_ACCESS_TOKEN}
export JENKINS_HOME=/var/lib/jenkins
export BACKUP_REPO=~/jenkins-backup
readonly CUR_DIR=$(cd $(dirname ${BASH_SOURCE:-$0}); pwd)