aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-08-20 21:02:00 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-08-20 21:02:00 -0300
commit0220c9924c6fb633e7cd55be548a1604fdf4f63c (patch)
tree08d2f1e4b5c5b1c3556fc81893619e73b0835285
parente851401694daacaf1aba2c87ed557e5dbf00af02 (diff)
downloadscripts-0220c9924c6fb633e7cd55be548a1604fdf4f63c.tar.gz
scripts-0220c9924c6fb633e7cd55be548a1604fdf4f63c.tar.bz2
Move scripts to other repositories (2)HEADmaster
-rw-r--r--README.md3
-rwxr-xr-xgallery22
-rwxr-xr-xicalbuddy8
l---------luakit-adblock-update1
-rwxr-xr-xopenvpn-resolv-conf46
-rwxr-xr-xpowersaving35
-rwxr-xr-xsri-hash34
-rwxr-xr-xweather-forecast36
-rwxr-xr-xweather-query40
-rwxr-xr-xwifi16
-rwxr-xr-xyoutube-player18
11 files changed, 2 insertions, 257 deletions
diff --git a/README.md b/README.md
index 89f2d50..b981799 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,4 @@
# Misc scripts
-This is an assorted collection of simple scripts to be available on `$PATH`.
+This repository is used as an assorted collection of simple scripts to be
+available on `$PATH`.
diff --git a/gallery b/gallery
deleted file mode 100755
index 45e46eb..0000000
--- a/gallery
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-#
-# Image galleries: a wrapper for sxiv(1).
-#
-
-# Parameters
-BASENAME="`basename $0`"
-IMAGES="$HOME/data/images"
-GALLERY="${1:-$IMAGES}"
-
-# Check
-if [ "$GALLERY" != "-" ] && [ ! -d "$GALLERY" ]; then
- echo "$BASENAME: path not found: $GALLERY"
- exit 1
-elif ! which sxiv &> /dev/null; then
- echo "$BASENAME: please install sxiv"
- exit 1
-fi
-
-# Dispatch
-# Option -o allows piping the selection output to other tools
-sxiv -t -q -b -o -r $GALLERY 2> /dev/null
diff --git a/icalbuddy b/icalbuddy
deleted file mode 100755
index d9e048d..0000000
--- a/icalbuddy
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-#
-# This is a placeholder command so xcal does not give errors when calling icalbuddy
-# See https://github.com/alxppp/xcal
-# http://hasseg.org/icalBuddy/
-
-# Do nothing, successfully
-/bin/true
diff --git a/luakit-adblock-update b/luakit-adblock-update
deleted file mode 120000
index 42263c4..0000000
--- a/luakit-adblock-update
+++ /dev/null
@@ -1 +0,0 @@
-/home/rhatto/.config/luakit/contrib/luakit-plugins/tools/adblock-update.sh \ No newline at end of file
diff --git a/openvpn-resolv-conf b/openvpn-resolv-conf
deleted file mode 100755
index 8c525cd..0000000
--- a/openvpn-resolv-conf
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-#
-# Parses DHCP options from OpenVPN to update resolv.conf.
-# To use set as 'up' and 'down' script in your openvpn config:
-# up /etc/openvpn/update-resolv-conf
-# down /etc/openvpn/update-resolv-conf
-#
-# credit:
-# * Thomas Hood <jdthood@yahoo.co.uk>
-# * Chris Hanson
-# * chlauber@bnc.ch
-#
-# Licensed under the GNU GPL
-
-[ -x /sbin/resolvconf ] || exit 0
-
-case $script_type in
- up)
- for optionname in ${!foreign_option_*} ; do
- option="${!optionname}"
- echo $option
- part1=$(echo "$option" | cut -d " " -f 1)
- if [ "$part1" == "dhcp-option" ] ; then
- part2=$(echo "$option" | cut -d " " -f 2)
- part3=$(echo "$option" | cut -d " " -f 3)
- if [ "$part2" == "DNS" ] ; then
- IF_DNS_NAMESERVERS="$IF_DNS_NAMESERVERS $part3"
- fi
- if [ "$part2" == "DOMAIN" ] ; then
- IF_DNS_SEARCH="$part3"
- fi
- fi
- done
- R=""
- if [ "$IF_DNS_SEARCH" ] ; then
- R="${R}search $IF_DNS_SEARCH\n"
- fi
- for NS in $IF_DNS_NAMESERVERS ; do
- R="${R}nameserver $NS"
- done
- echo -n "$R" | /sbin/resolvconf -a "${dev}.inet"
- ;;
- down)
- /sbin/resolvconf -d "${dev}.inet"
- ;;
-esac
diff --git a/powersaving b/powersaving
deleted file mode 100755
index 75c5605..0000000
--- a/powersaving
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-# from https://geoff.greer.fm/2017/07/16/thinkpad-x62/
-
-# Disable the NMI watchdog
-echo '0' > '/proc/sys/kernel/nmi_watchdog';
-
-# Runtime power management for I2C devices
-for i in /sys/bus/i2c/devices/*/device/power/control ; do
- echo auto > ${i}
-done
-
-# Runtime power-management for PCI devices
-for i in /sys/bus/pci/devices/*/power/control ; do
- echo auto > ${i}
-done
-
-# Runtime power-management for USB devices
-for i in /sys/bus/usb/devices/*/power/control ; do
- echo auto > ${i}
-done
-
-# Low power SATA
-for i in /sys/class/scsi_host/*/link_power_management_policy ; do
- echo min_power > ${i}
-done
-
-# Disable Wake-on-LAN on ethernet port
-#ethtool -s wlan0 wol d;
-#ethtool -s eth0 wol d
-
-#Enable Audio codec power management
-echo '1' > '/sys/module/snd_hda_intel/parameters/power_save';
-
-# Low power wireless
-iw dev wlan0 set power_save on
diff --git a/sri-hash b/sri-hash
deleted file mode 100755
index 5979c39..0000000
--- a/sri-hash
+++ /dev/null
@@ -1,34 +0,0 @@
-#/bin/sh
-#
-# SRI Hash Generator
-#
-
-# Parameters
-BASENAME="`basename $0`"
-URI="$1"
-
-# Check
-if [ -z "$URI" ]; then
- echo "usage: $BASENAME <file-or-url>"
- exit 1
-fi
-
-# Get file
-if echo "$URI" | grep -q '^http'; then
- echo "downloading $URI and generating hash..."
- HASH="`curl $URI | openssl dgst -sha384 -binary | openssl base64 -A`"
- echo ""
-else
- if [ -e "$URI" ]; then
- # See https://www.srihash.org/
- HASH="`openssl dgst -sha384 -binary $URI | openssl base64 -A`"
- else
- echo "file not found: $URI"
- exit 1
- fi
-fi
-
-# Generate
-cat <<EOF
-<script src="$URI" integrity="sha384-$HASH" crossorigin="anonymous"></script>
-EOF
diff --git a/weather-forecast b/weather-forecast
deleted file mode 100755
index 269f740..0000000
--- a/weather-forecast
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-#
-# Simple wrapper around wttr.in
-#
-
-# Parameters
-BASENAME="`basename $0`"
-PROGRAM="$1"
-CACHE="$HOME/.local/share/weather"
-
-# Load config
-source $HOME/.custom/wttr.in.conf || exit 1
-
-# weather-forecast service query
-function weather_forecast_query {
- # Make sure everything we need exists
- mkdir -p $CACHE
- touch $CACHE/weather-forecast.cur $CACHE/weather-forecast.prev
-
- # Save the previous forecast
- cp $CACHE/weather-forecast.cur $CACHE/weather-forecast.prev
- curl wttr.in/$LOCATION > $CACHE/weather-forecast.cur 2> /dev/null
-
- # Test if current forecast is empty, meaning
- # that we're probably ofline. In that case
- # we provide the previous output.
- if [ ! -s "$CACHE/weather-forecast.cur" ]; then
- cp $CACHE/weather-forecast.prev $CACHE/weather-forecast.cur
- fi
-
- # Display output
- cat $CACHE/weather-forecast.cur
-}
-
-# Main
-weather_forecast_query
diff --git a/weather-query b/weather-query
deleted file mode 100755
index f834415..0000000
--- a/weather-query
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-#
-# Simple wrapper around brweather
-#
-
-# Parameters
-BASENAME="`basename $0`"
-PROGRAM="$1"
-CACHE="$HOME/.local/share/weather"
-
-# Command line args
-shift
-
-# Weather service query
-function weather_query {
- # Make sure everything we need exists
- mkdir -p $CACHE
- touch $CACHE/weather.cur $CACHE/weather.prev
-
- # Save the previous forecast
- cp $CACHE/weather.cur $CACHE/weather.prev
- weather $* > $CACHE/weather.cur 2> /dev/null
-
- # Test if current forecast is empty, meaning
- # that we're probably ofline. In that case
- # we provide the previous output.
- if [ ! -s "$CACHE/weather.cur" ]; then
- cp $CACHE/weather.prev $CACHE/weather.cur
- fi
-
- # Display output
- cat $CACHE/weather.cur
-}
-
-# Main
-if [ "$PROGRAM" == 'brweather' ]; then
- brweather $* | grep -v 'Erro.'
-else
- weather_query
-fi
diff --git a/wifi b/wifi
deleted file mode 100755
index 6a3a3b5..0000000
--- a/wifi
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-#
-# Wifi initializer
-#
-
-#DEVICE="ath0"
-DEVICE="wlan0"
-
-if [ ! -z "$1" ]; then
- read -sp "Enter the WPA passphrase: " PASS
- echo ""
- wpa_passphrase $1 $PASS
-elif [ -f "wpa_supplicant.conf" ]; then
- sudo wpa_supplicant -B -Dwext -i$DEVICE -cwpa_supplicant.conf
- sudo dhclient $DEVICE
-fi
diff --git a/youtube-player b/youtube-player
deleted file mode 100755
index 46b8dd5..0000000
--- a/youtube-player
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-#
-# Youtube player from the command line
-# https://unix.stackexchange.com/questions/160212/watch-youtube-videos-in-terminal
-#
-
-# Parameters
-BASENAME="`basename $0`"
-URL="$1"
-
-# Check
-if [ -z "$1" ]; then
- echo "usage: $BASENAME <url>"
- exit 1
-fi
-
-# Run
-youtube-dl $URL -o - | mplayer -vo aa -monitorpixelaspect 0.5 -