Skip to content

Instantly share code, notes, and snippets.

@rvprasad
Last active December 19, 2019 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rvprasad/10b28470d7939ffd91cd1178cdc46713 to your computer and use it in GitHub Desktop.
Save rvprasad/10b28470d7939ffd91cd1178cdc46713 to your computer and use it in GitHub Desktop.
Configure a Raspberry Pi cluster using cloud-init and then install few packages
hdmi_safe=1
enable_uart=0
gpu_mem=16
sudo apt update
sudo apt upgrade -y
sudo apt install -y vim-tiny tmux glances oracle-java8-jdk nginx
sudo apt install -y erlang erlang-dev elixir
sudo apt install -y snapd flatpak
sudo apt install -y python3 python3-pip python3-dev
pip3 install django flask
sudo apt install -y unzip zip gnupg2 dirmngr
curl -s "https://get.sdkman.io" | bash
. ~/.sdkman/bin/sdkman-init.sh
sdk install groovy
sdk install kotlin
sdk install kscript
sdk install micronaut
sdk install scala
sdk install vertx
sudo apt install -y python-zmq
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt install -y nodejs
sudo apt install -y git curl zlib1g-dev subversion
sudo apt install -y openssl libreadline6-dev git-core zlib1g libssl-dev
sudo apt install -y libyaml-dev libsqlite3-dev sqlite3
sudo apt install -y libxml2-dev libxslt-dev
sudo apt install -y autoconf automake libtool bison
gpg --keyserver hkp://keys.gnupg.net \
--recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable --ruby=ruby --gems=rails
echo "gem: --no-document" > ~/.gemrc
#cloud-config
# vim: syntax=yaml
#
hostname: master10
manage_etc_hosts: true
apt_preserve_sources_list: true
users:
- name: life
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
groups: users,docker
plain_text_passwd: asdf
lock_passwd: false
ssh_pwauth: true
chpasswd: { expire: false }
package_upgrade: false
write_files:
- content: |
iface eth0 inet static
address 192.168.2.10
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
path: /etc/network/interfaces.d/eth0
- content: |
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
path: /etc/network/interfaces.d/wlan0
- content: |
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="" # enter the SSID of your network in quotes
psk="" # enter the password for the network in quotes
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
path: /etc/wpa_supplicant/wpa_supplicant.conf
- content: |
#!/bin/sh -e
exec 2> /tmp/rc.local.log
exec 1>&2
set -x
systemctl restart avahi-daemon
timedatectl set-timezone America/Chicago
ifup eth0
ip link set wlan0 down
exit 0
path: /etc/rc.local
permissions: '0755'
runcmd:
- '/etc/rc.local'
sudo ip link set wlan0 up
sleep 10
sudo apt update
sudo apt -y upgrade
pip3 install -U django flask
. ~/.sdkman/bin/sdkman-init.sh
sdk update
sdk ug
sdk flush temp
sdk flush archives
sdk uninstall groovy 2.5.0
sdk uninstall vertx 3.5.2
rvm get stable --auto-dotfiles
rvm remove ruby 2.4.1
rvm install ruby --latest
rvm install jruby 9.2.0.0
rvm reload
rvm use ruby
gem install rails
sudo ip link set wlan0 down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment