Skip to content

Instantly share code, notes, and snippets.

View qb0C80aE's full-sized avatar
🎃
looks yummy

localhost qb0C80aE

🎃
looks yummy
View GitHub Profile
@qb0C80aE
qb0C80aE / rbenv.sh
Created May 11, 2017 00:06
rbenv on Ubuntu 16.04
#!/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}
@qb0C80aE
qb0C80aE / android_chroot.sh
Last active August 9, 2024 23:41
run linux on android by chroot in case that android device doesn't have enought free space.
#!/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
@qb0C80aE
qb0C80aE / gist:f7b12e2552cb2cec4e1a
Last active August 29, 2015 14:16
docker_cleanup.sh
#!/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
@qb0C80aE
qb0C80aE / openvnet-docker-demo-cleanup.sh
Last active August 29, 2015 14:10
Docker container and network configuration for OpenVNet DEMO
#!/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}