Skip to content

Instantly share code, notes, and snippets.

@csabatini
Last active February 29, 2016 17:44
Show Gist options
  • Save csabatini/6fc75b7da205eb2022b4 to your computer and use it in GitHub Desktop.
Save csabatini/6fc75b7da205eb2022b4 to your computer and use it in GitHub Desktop.
#!/bin/bash
# format + mount disks
(echo c; echo u; echo n; echo p; echo 1; echo ; echo ; echo p; echo w;) | fdisk /dev/sdc
mkfs.ext4 /dev/sdc1
mkdir -p /media/pd0
mount /dev/sdc1 /media/pd0
cp /etc/fstab ~/
cp /etc/fstab /etc/fstab.original
uuid=$(blkid | grep '/dev/sdc1' | grep -oP '[-a-z0-9]{36}')
echo "UUID=${uuid} /media/pd0 ext4 defaults 0 0" >> ~/fstab
mv ~/fstab /etc/fstab
# install packages
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y openjdk-7-jdk likewise-open5
# edit /etc/sudoers for admin group
sed -i 's/%admin ALL=(ALL) ALL/%admin ALL=(ALL) NOPASSWD:ALL/g' /etc/sudoers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment