This is a general-purpose function to ask Yes/No questions in Bash, either with or without a default answer. It keeps repeating the question until it gets a valid answer.
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
Based on https://miloserdov.org/?p=659 | |
Hardware: | |
- TP-Link TL-WN722N + TP-Link TL-ANT2408CL | |
- Raspberry Pi 3 | |
1.) Get Archlinux für Raspberry | |
RaspArch Build 181117 (http://raspex.exton.se/?p=983) | |
Download (https://sourceforge.net/projects/rasparch/files/latest/download) |
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
IP Address Location | |
89.187.177.134 NYC | |
89.187.177.138 NYC | |
89.187.177.196 NYC | |
89.187.178.130 NYC | |
89.187.179.35 NYC | |
89.187.185.130 LAX | |
89.187.185.153 LAX |
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 -x | |
set -euf -o pipefail | |
# Test if sudo exists, comment out if sudo isn't installed | |
command -v sudo >/dev/null 2>&1 || { printf 'I require to be run as root, or sudo to be installed. Aborting. \n' >&2; exit 1; } | |
# Setting gateway's needs root privileges, elevate with sudo, tested on kernel 5.8.5-arch1-1. | |
# Comment out if script is called as root | |
if [ "$EUID" != 0 ]; then | |
sudo "${BASH_SOURCE[0]}" "$@" |
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
#!/usr/bin/bash | |
function pacman-last-used { | |
storage_dir=${HOME}/.config/pacman-last | |
mkdir -p "$storage_dir" | |
unsorted=$storage_dir/"packages.1.exec_bins.log" | |
sorted=$storage_dir/"packages.2.exec_bins.sorted" | |
sorted_packs=$(mktemp) #"3.packages.sorted" |
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 | |
#METHOD=netperf | |
METHOD=nuttcp | |
HOST=ref1 | |
HOSTIP="192.168.0.2" | |
TARGETUSER=root | |
TARGET=target |