This file contains hidden or 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 | |
# Set defaults if not provided by environment | |
CHECK_DELAY=${CHECK_DELAY:-5} | |
CHECK_IP=${CHECK_IP:-8.8.8.8} | |
PRIMARY_IF=${PRIMARY_IF:-eth0} | |
PRIMARY_GW=${PRIMARY_GW:-1.2.3.4} | |
BACKUP_IF=${BACKUP_IF:-eth1} | |
BACKUP_GW=${BACKUP_GW:-2.3.4.5} |
This file contains hidden or 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 | |
IPT="/sbin/iptables" | |
# Server IP | |
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')" | |
# Your DNS servers you use: cat /etc/resolv.conf | |
DNS_SERVER="8.8.4.4 8.8.8.8" | |
# Allow connections to this package servers |
This file contains hidden or 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
# Get Pre-reqs | |
apt-get install libattr1-dev git unzip make gcc automake pkg-config | |
# Get Android NDK | |
cd /root | |
mkdir -p build && cd build | |
wget http://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip -O /tmp/android-ndk-r10e-linux-x86_64.zip | |
unzip /tmp/android-ndk-r10e-linux-x86_64.zip -d /root/build | |
# Set paths |
This file contains hidden or 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
RECOVERY='chromeos_10452.96.0_asuka_recovery_stable-channel_mp' | |
echo 'cd ~/Downloads/' >> ~/.bashrc | |
mkdir /home/chronos/image /home/chronos/local /home/chronos/user/Downloads/boot | |
cd /home/chronos/user/Downloads/boot | |
wget https://dl.google.com/dl/edgedl/chromeos/recovery/$RECOVERY.bin.zip | |
unzip $RECOVERY.bin.zip | |
sudo losetup -fP $RECOVERY.bin | |
sudo mkfs.ext4 /dev/sda5 | |
sudo mount /dev/sda5 /home/chronos/local | |
sudo mount /dev/loop1p3 /home/chronos/image -o loop,ro |
This file contains hidden or 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 | |
# Source https://stackoverflow.com/questions/36651091/how-to-install-packages-in-linux-centos-without-root-user-with-automatic-depen | |
pkgname=$1 | |
if [ -z $pkgname ]; then | |
echo "Usage: ./non-root-yum-install.sh pkgname-here" | |
exit 1 | |
fi | |
rand=$(openssl rand -base64 6) |