Skip to content

Instantly share code, notes, and snippets.

@hiono
Last active January 25, 2018 05:46
Show Gist options
  • Save hiono/03e7af45b4755d1e675130f592cf467f to your computer and use it in GitHub Desktop.
Save hiono/03e7af45b4755d1e675130f592cf467f to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
sudo add-apt-repository -y ppa:ubuntu-elisp/ppa
sudo apt-add-repository -y ppa:git-core/ppa
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get -y install ntp wget curl sed
sudo systemctl stop ntp.service
# setup ntp
source <(curl -fsSkL https://gist.github.com/hiono/9636356/raw/ntp)
function ntp-setup () {
local sedscript_ntp=$(mkfile ntp <<EOF
s/^server ntp.ubuntu.com/server ntp01.idc.renesas.com/g
s/^server 0.ubuntu.pool.ntp.org/server ntp01.idc.renesas.com/g
s/^server 1.ubuntu.pool.ntp.org/server ntp02.idc.renesas.com/g
s/^server 2.ubuntu.pool.ntp.org/server ntp01.mu.renesas.com/g
s/^server 3.ubuntu.pool.ntp.org/server ntp02.mu.renesas.com/g
EOF
)
local sedscript_ntpdate=$(mkfile ntpdate <<EOF
s/^NTPSERVERS="ntp.ubuntu.com"/NTPSERVERS="ntp01.idc.renesas.com"/g
EOF
)
log_action_begin_msg "ntp"
ntp_install
ntp_config ${sedscript_ntp}
ntpdate_config ${sedscript_ntpdate} ntp01.idc.renesas.com
log_action_end_msg 0
rm -f ${sedscript_ntp} ${sedscript_ntp_date}
}
ntp-setup
# Amazonの広告などを無効化
gsettings set com.canonical.Unity.Lenses disabled-scopes "['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope', 'more_suggestions-populartracks.scope', 'music-musicstore.scope', 'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope', 'more_suggestions-skimlinks.scope']"
# Ubuntu Web Appsを削除
sudo apt-get remove unity-webapps-common xul-ext-unity xul-ext-websites-integration
sudo apt-get -y install emacs-snapshot git build-essential
sudo apt-get -y install docker-ce docker-compose && \
sudo sudo groupadd docker && \
sudo usermod -aG docker $USER && \
sudo systemctl restart docker.service
sudo pkill -SIGHUP dockerd
git clone https://github.com/yascentur/RictyDiminished.git /tmp/RictyDiminished
pushd /tmp/RictyDiminished
sudo cp *.ttf /usr/local/share/fonts/
popd
rm -rf /tmp/RictyDiminished
sudo fc-cache -fv
# for keyboard problem
gsettings set org.gnome.settings-daemon.plugins.keyboard active false
pushd /tmp
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/nvidia-390_390.12-0ubuntu1_amd64.deb
sudo dpkg -i nvidia-390_390.12-0ubuntu1_amd64.deb
popd
## If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo apt-get purge -y nvidia-docker
# Add the package repositories
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu16.04/amd64/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
# Install nvidia-docker2 and reload the Docker daemon configuration
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd
# Test nvidia-smi with the latest official CUDA image
docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
sudo apt-get -y upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment