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 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
| #!/usr/sbin/nft -f | |
| ## vim: ft=pf | |
| flush ruleset | |
| define wan = eth0 | |
| define cjd = tun0 | |
| define wg_int = wg0 | |
| define vpn_gw = 192.168.10.1 | |
| define vpn_net = 192.168.10.0/24 | |
| define proto_allow = { ah, esp, igmp, ipv6 } |
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
| #!/hint/bash | |
| # | |
| # /etc/makepkg.conf | |
| # | |
| ######################################################################### | |
| # SOURCE ACQUISITION | |
| ######################################################################### | |
| # | |
| #-- The download utilities that makepkg should use to acquire sources |
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
| [Unit] | |
| Description=AutoSSH tunnel to remote signald Unix socket | |
| After=network-online.target | |
| # Note: user systemd instances do not see system-level targets like | |
| # network-online.target by default, so this ordering hint is not | |
| # guaranteed to work in a user unit. For reliable boot ordering, | |
| # either run this as a system unit, or ensure the user session is | |
| # started after the network via PAM/loginctl-linger configuration. | |
| [Service] |
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
| root@apu:~# time awk 'BEGIN { OFMT = "%.0f"; for (i = 0; i < 50000; i++) print (95/100 * 42) }' > /dev/null | |
| real 0m0.517s | |
| user 0m0.435s | |
| sys 0m0.081s | |
| root@apu:~# time awk 'BEGIN { for (i = 0; i < 50000; i++) printf("%.0f\n", (95/100 * 42)) }' > /dev/null | |
| real 0m0.862s | |
| user 0m0.624s | |
| sys 0m0.237s |
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/sh | |
| # v0.1 Avinash H. Duduskar <strykar@live.com> | |
| # This adjusts OpenWRT SQM settings by re-calculating up/down bandwidth | |
| # Needs the Speedtest.net CLI binary - https://www.speedtest.net/apps/cli | |
| # Call this script every 4 or 6 hours via cron | |
| set -euf -o pipefail | |
| _sqm_int="queue" # Your actual wan interface: ifstatus wan | grep -e l3_device | |
| _pul="90" # Percentage of wan upload speed to set, 90-95 is good | |
| _pdl="95" # Percentage of wan download speed to set, 90-95 is good |
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
| # | |
| # Copyright (C) 2006-2015 OpenWrt.org | |
| # | |
| # This is free software, licensed under the GNU General Public License v2. | |
| # See /LICENSE for more information. | |
| # | |
| include $(TOPDIR)/rules.mk | |
| PKG_NAME:=ncurses |
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
| ========== | |
| VULKANINFO | |
| ========== | |
| Vulkan Instance Version: 1.2.153 | |
| Instance Extensions: count = 17 | |
| =============================== | |
| VK_EXT_acquire_xlib_display : extension revision 1 |
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 -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 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
| socat -v /dev/cuaU0,ispeed=115200,ospeed=115200,echo=0,raw TCP4-LISTEN:1234,reuseaddr,nodelay |