Skip to content

Instantly share code, notes, and snippets.

@nickboldt
Last active January 29, 2019 20:49
Show Gist options
  • Save nickboldt/c20d306155501fdc4490f834b406eec1 to your computer and use it in GitHub Desktop.
Save nickboldt/c20d306155501fdc4490f834b406eec1 to your computer and use it in GitHub Desktop.
F27 VM config checklist
##########################
# VM CONFIG
##########################
# install rpmfusion free, non-free
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
# install kernel headers and gcc
dnf -y update
dnf -y install kernel kernel-headers kernel-devel gcc alien yum-utils
# install VBox extensions; reboot
##########################
# BASE SOFTWARE INSTALLS
##########################
# download/install chrome, sublime, beyond compare
dnf -y install xfce4-screenshooter-plugin xfce4-notes-plugin xfce4-timer-plugin xfce4-screenshooter xfce4-mixer \
xfce4-datetime-plugin xfce4-pulseaudio-plugin xfce4-terminal xfce4-clipman-plugin arandr pidgin firefox \
ccrypt vim vim-common vim-enhanced tycho httpd php perl python ruby java jre maven mock eclipse git sshfs openssl \
kernel kernel-headers kernel-devel gcc-c++ gcc alien vpnc Xvfb gimp ImageMagick vinagre docker docker-engine \
krb5-auth-dialog krb5-libs kredentials kstart sssd-krb5-common sssd krb5-workstation bison sqlite-devel zlib-devel \
eclipse-m2e-wtp eclipse-m2e-core java-1.8.0-openjdk-devel jdk-9.0.1 libffi-devel libtool readline-devel \
libyaml-devel openssl-devel maven-surefire-report-parser libreoffice-writer libreoffice-calc xsel xdotool xclip ncdu
################################################################
# Forgot something? Here's the complete list of installs!
for i in $(dnf history | grep -v "Altered" | grep install | sed -e "s#[\t ]\+\([0-9]\+\)[\t ]\+|.\+#\1#" | tac); do
dnf history info $i | grep Command | sed -e "s#.\+ : #dnf -y #";
done
################################################################
##########################
# PANEL CONFIG
##########################
# panel prefs: 24px wide
# launchers: screenshooter, terminal, thunar, sublime, chrome, [others]
# Set chrome launcher to use:
# /usr/bin/google-chrome-stable --auth-server-whitelist="*.redhat.com" %U
# Orage Panel clock
# font: Sans 8
# height: 32
# width: 70
# line1: %Y-%m-%d %H:%M
# tooltip: %x %X / W%V
##########################
# HOME DIR SETUP
##########################
# set up symlinks
cd ~; mv ~/Downloads ~/tmp; ln -s tmp/ Downloads
# Copy to new machine:
~/bin folder (including sublime & bcompare licenses)
~/.alias, ~/.bashrc, ~/.bash_profile, ~/.gitconfig
~/.ssh
~/tmp, ~/1, ~/2, ~/3, ~/4, ~/eclipse
~/.purple (pidgin)
~/Documents/2017
~/RedHat/2017
# copy sublime settings and plugins to new machine
unzip ~/bin/dot-config-sublime-text-3.zip -d ~/.config/
# copy yum.repos.d files - add in RH internal URLs for Brew, etc.
scpr ~/bin/etc-yum.repos.d /etc/yum/repos.d/
# disable selinux in /etc/selinux/config
# set up visudo
##########################
# VPN SETUP
##########################
# install vpn stuff (see ~/RedHat/2017/vpn/*.rpm)
dnf install -y redhat-internal-cert-install-0.1-7.el7.csb.noarch.rpm redhat-internal-NetworkManager-openvpn-profiles-0.1-29.el7.csb.noarch.rpm \
redhat-internal-NetworkManager-openvpn-profiles-non-gnome-0.1-29.el7.csb.noarch.rpm redhat-internal-openvpn-profiles-0.1-29.el7.csb.noarch.rpm
#run VPN
V
##########################
# DEV ENV SETUP
##########################
# add ant-contrib to ant lib folder so it's available for mirroring devstudio TP requirements
sudo yum install ant-contrib
mkdir -p $HOME/.ant/lib
cp /usr/share/java/ant-contrib/ant-contrib.jar $HOME/.ant/lib/
# install pip and required packages
cd /tmp
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install --upgrade pip
pip install PyXB jira pygithub
##########################
# RHEL SUBSCRIPTION
##########################
subscription-manager register --auto-attach --username "$SUBSCRIPTION_USERNAME" --password "$SUBSCRIPTION_PASSWORD"
##########################
# set up rhpkg & fedpkg
##########################
# 1. install rpms
dnf install -y javapackages-local fedora-packager brew-tools koji rhpkg brewkoji-test brewkoji-stage brewkoji \
fedpkg python2-rpkg python-virtualenvwrapper libffi-devel sssd krb5-workstation krb5-auth-dialog xmvn
# 2. install certs: see https://docs.engineering.redhat.com/display/KB/Troubleshooting+Tips#TroubleshootingTips-SSLerrortroubleshooting and https://mojo.redhat.com/docs/DOC-999615#jive_content_id_Certificates
# 3. fix for using pip installed python - https://projects.engineering.redhat.com/browse/RCM-18993
echo "" >> ~/.bashrc
echo "fix for using pip installed python - https://projects.engineering.redhat.com/browse/RCM-18993" >> ~/.bashrc
echo "export REQUESTS_CA_BUNDLE=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" >> ~/.bashrc
# Set up kerberos/kinit:
google-chrome https://mojo.redhat.com/docs/DOC-1017803 https://mojo.redhat.com/docs/DOC-1011190
# Set up PNC cli
cd /tmp
git clone https://github.com/project-ncl/pnc-cli.git
cd pnc-cli
export PYTHONPATH=`pwd`
python setup.py install --user
pnc -h #help
##########################
# install hub and rvm
##########################
google-chrome https://github.com/github/hub/releases
google-chrome https://rvm.io/rvm/install
# install git hook via https://til.hashrocket.com/posts/c89a35a66c-global-git-hooks
mkdir -p ~/.git-templates/hooks
git config --global init.templatedir '~/.git-templates'
# use this hook to add Change-Id to all commits, so we can edit gerrits (push changes) instead of having to submit new ones
scp -p -P 29418 nickb@git.eclipse.org:hooks/commit-msg ~/.git-templates/hooks/
# install node and npm
dnf install -y node npm
# In /opt/:
# download & unpack maven 3.5
# download & unpack JDK 8 and 9
# set up alternatives so jdk 8 is default
# rebuild hudson-job-sync-plugin
# import certs from ~/bin/certs into JDK cert store using ~/bin/cert.import.sh
mvn clean install ~/2/maven-plugins/hudson-job-sync-plugin
cp ~/bin/pom-*-internal.xml ~/truu/jbdevstudio-ci
# build, then add panel link to ~/bin/p2browser/
# build p2diff in ~/bin/p2diff/
# open ephemeral and 8080 ports on firewall
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -I INPUT 1 -i eth0 -p tcp --dport 8080 -j ACCEPT
#############################################
# install docker-ce
# from https://docs.docker.com/install/linux/docker-ce/fedora/#install-using-the-repository
# install docker-machine-driver-kvm, oc and minishift
# https://github.com/openshift/origin/releases
# https://docs.openshift.org/latest/minishift/getting-started/installing.html#installing-instructions
# install libvirt
sudo dnf install libvirt qemu-kvm -y && sudo usermod -a -G libvirt $USER && newgrp libvirt
# make sure libvirt is running
sudo service libvirtd restart
sudo su
curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.7.0/docker-machine-driver-kvm -o /usr/local/bin/docker-machine-driver-kvm
chmod +x /usr/local/bin/docker-machine-driver-kvm
cd /opt
curl -o oc.tgz -L https://github.com/openshift/origin/releases/download/v3.9.0/openshift-origin-client-tools-v3.9.0-191fece-linux-64bit.tar.gz
tar xvzf oc.tgz && rm -f oc.tgz
curl -o ms.tgz -L https://github.com/minishift/minishift/releases/download/v1.15.1/minishift-1.15.1-linux-amd64.tgz
tar xvzf ms.tgz && rm -f ms.tgz
exit
# enable docker daemon
sudo systemctl start docker # started
sudo systemctl enable docker # enabled on startup
# symlink from a PATH-visible folder like ~/bin
cd ~/bin/
rm -f oc minishift
ln -s /opt/openshift-origin-client-tools-*/oc
ln -s /opt/minishift-*/minishift
# verify minishift and oc work with che, via https://www.eclipse.org/che/docs/openshift-single-user.html
cd /tmp; git clone https://github.com/minishift/minishift-addons
minishift addons install /tmp/minishift-addons/add-ons/che
minishift addons enable che
minishift addons apply \
--addon-env CHE_DOCKER_IMAGE=eclipse/che-server:nightly \
--addon-env OPENSHIFT_TOKEN=$(oc whoami -t) \
che
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment