Add scripts, configurations, docs from borgcube
This commit is contained in:
24
bin/git-reset-master
Executable file
24
bin/git-reset-master
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
git_workdir=$(git rev-parse --show-toplevel)
|
||||
|
||||
echo -n "CHECK master branch: "
|
||||
if [[ "$current_branch" != "master" ]]; then
|
||||
echo "BAD branch $current_branch"
|
||||
exit 1
|
||||
fi
|
||||
echo "OK"
|
||||
|
||||
echo -n "CHECK root workdir: "
|
||||
if [[ "$git_workdir" != "$PWD" ]]; then
|
||||
echo "BAD"
|
||||
exit 2
|
||||
fi
|
||||
echo "OK"
|
||||
echo
|
||||
echo "git fetch"
|
||||
git fetch
|
||||
echo "git reset --hard origin/master"
|
||||
git reset --hard origin/master
|
||||
|
||||
9
bin/tss
Executable file
9
bin/tss
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from sys import stdin, stdout
|
||||
from time import time
|
||||
|
||||
start = time()
|
||||
for line in stdin:
|
||||
stamp = time() - start
|
||||
stdout.write(f"{stamp:0.6f} {line}")
|
||||
14
bin/wifi-power-off
Executable file
14
bin/wifi-power-off
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# https://unix.stackexchange.com/questions/269661/how-to-turn-off-wireless-power-management-permanently
|
||||
# /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
|
||||
# [connection]
|
||||
# wifi.powersave = 2
|
||||
|
||||
#DEVICE=wlp0s20f3
|
||||
DEVICE=$(ip route list default | awk '{ print $5 }')
|
||||
echo "Device $DEVICE"
|
||||
ip -c -4 addr show dev $DEVICE
|
||||
|
||||
iwconfig $DEVICE power off
|
||||
|
||||
Reference in New Issue
Block a user