This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RUBY_VERSION=2.3.4 | |
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev | |
git clone https://github.com/rbenv/rbenv.git ~/.rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
source ~/.bashrc | |
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build | |
rbenv install ${RUBY_VERSION} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/system/bin/sh | |
cd /data/local/tmp | |
mount -o bind /dev /data/local/tmp/linux_root/dev | |
mount -o bind /dev/pts /data/local/tmp/linux_root/dev/pts | |
mount -t sysfs /sys /data/local/tmp/linux_root/sys | |
mount -t proc /proc /data/local/tmp/linux_root/proc | |
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/system/bin:/system/xbin | |
export TERM=xterm | |
export HOME=/root | |
chroot /data/local/tmp/linux_root /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# crontab: 0 * * * * root /usr/sbin/docker-clean.sh | |
docker ps -a | grep Exited | awk '{print $1'} | xargs docker rm | |
docker images -a | grep none | awk '{print $3'} | xargs docker rmi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BRIDGE=br0 | |
ovs-vsctl show | grep "Port \"veth" | awk '{print $2}' | sed -e 's/"//g' | while read port; do | |
ovs-vsctl del-port ${BRIDGE} ${port} | |
done | |
docker ps | awk '{print $1}' | grep -v grep | grep -v CONTAINER | while read container_id; do | |
docker kill ${container_id} |