diff --git a/bone_xfce.sh b/bone_xfce.sh new file mode 100644 index 0000000000000000000000000000000000000000..4d8c0b3f2b62dfc8d00905337c5d1002038a86e3 --- /dev/null +++ b/bone_xfce.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +xfconf-query -c keyboard-layout -p "/Default/XkbDisable" -s "false" +xfconf-query -c keyboard-layout -p "/Default/XkbLayout" -s "de" +xfconf-query -c keyboard-layout -p "/Default/XkbVariant" -s "bone" + diff --git a/memory_usage.sh b/memory_usage.sh new file mode 100755 index 0000000000000000000000000000000000000000..de5aac76cddee51480a8f10e91d043d5565a1750 --- /dev/null +++ b/memory_usage.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +argparse --exclusive c,p --max-args 1 'c/command' 'p/pid' -- $argv + +set -q _flag_command ; and set psargs -eC $argv[2] +ps -eo pid,size,command | grep $1 +ps -eo size,command | grep $1 | awk '{ hr=$1/1024 ; sum += hr} END {print sum " MiB"}' + diff --git a/modprobe_old_kernel.sh b/modprobe_old_kernel.sh new file mode 100755 index 0000000000000000000000000000000000000000..d92986242598966740aa0b6ec33314404ddd5754 --- /dev/null +++ b/modprobe_old_kernel.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env fish + +# fancy select kernel version +set kernel_pkg (ls -1 /var/cache/pacman/pkg/linux* | grep -E '(.*)linux[[:digit:]]+-[[:digit:]]+(.*)' | fzf) +# even fancier select kernel version +#set kernel_pkg (ls -1 | grep "linux-"(string replace "-MANJARO" "" (uname -r)) + +#echo $kernel_pkg +#echo $argv[1] + +set tempdir (mktemp -d || exit) +cd $tempdir + +function on_exit_rm_tempdir --on-event fish_exit + prevd + rm -rf $tempdir +end + +tar xf $kernel_pkg || exit +sudo modprobe -d usr $argv[1] diff --git a/mount_8tb.sh b/mount_8tb.sh new file mode 100755 index 0000000000000000000000000000000000000000..cdd50e2dd479d52c0cdc78b723456b3df387aaff --- /dev/null +++ b/mount_8tb.sh @@ -0,0 +1,4 @@ +id +sudo cryptsetup luksOpen --key-file /root/8tb_keyfile /dev/disk/by-uuid/b94a609d-d734-4cae-bc6a-2f4dcff47afd luks-b94a609d-d734-4cae-bc6a-2f4dcff47afd || exit 1 +sudo vgchange -ay BackupGroup || exit 2 +udisksctl mount --block-device /dev/disk/by-uuid/5b4b9e59-eaef-4189-bb4c-42d81f9b94ee || exit 3 diff --git a/onedrive.sh b/onedrive.sh new file mode 100755 index 0000000000000000000000000000000000000000..8bea746c44cc4b0f45071bcd6a86874f1a0eb73e --- /dev/null +++ b/onedrive.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env fish + + +if [ $argv[1] = '--help' ] + echo "\ +Dieses Skript wird vor den Aufruf eines Kommandos gestellt und setzt die nötigen +rclone-Variablen. Wenn restic als Kommando erkannt wird, werden auch hier +Parameter für das backup/restic repository vorangestellt injiziert.\ + " + exit +end + +set -x RCLONE_CONFIG_PASS (cat $HOME/Documents/__wichtig__/passwords/rclone_config) + +# Debugging rclone +#set -x RCLONE_VERBOSE 2 + +set restic_args -r=rclone:onedrive_ohm:/backup/restic \ + --password-command="cat $HOME/Documents/__wichtig__/passwords/restic_onedrive_ohm" + +if [ $argv[1] = 'restic' ] + restic $restic_args $argv[2..] +else + exec $argv +end + diff --git a/pa_virtual.sh b/pa_virtual.sh index 5a511a8fd689f68e175878e0d82db129098f6d0b..b774f5c41974b0a3464aedc3e8b239c8a747727b 100755 --- a/pa_virtual.sh +++ b/pa_virtual.sh @@ -2,5 +2,5 @@ pacmd load-module module-null-sink sink_name=MySink pacmd update-sink-proplist MySink device.description=MySink pacmd update-source-proplist "MySink.monitor" device.description="\"MySink Monitor\"" -pacmd load-module module-loopback sink=MySink source=alsa_input.usb-Kingston_HyperX_Cloud_II_Wireless_000000000001-00.mono-fallback +#pacmd load-module module-loopback sink=MySink source=alsa_input.usb-Kingston_HyperX_Cloud_II_Wireless_000000000001-00.mono-fallback pacmd load-module module-loopback source=MySink.monitor sink=alsa_output.usb-Kingston_HyperX_Cloud_II_Wireless_000000000001-00.analog-stereo diff --git a/restic_docs.sh b/restic_docs.sh deleted file mode 100755 index ba59f728b77df039d2577ff2afe3beb5782bdc05..0000000000000000000000000000000000000000 --- a/restic_docs.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -export RCLONE_CONFIG_PASS=$(cat $HOME/Documents/__wichtig__/passwords/rclone_config) - - - -myrestic=(-r=rclone:onedrive_ohm:/backup/docs \ - --password-command="cat $HOME/Documents/__wichtig__/passwords/restic_onedrive_ohm") - -#echo $myrestic -#restic "${myrestic[@]}" unlock -# Read a string with spaces using for loop -for backup_path in "$HOME/Documents" "$HOME/scripts" "$HOME/Sync/pymass.kdbx" "/crypto_keyfile.bin" -do -# RCLONE_CONFIG_PASS=$(cat $HOME/Documents/__wichtig__/passwords/rclone_config) restic \ -# -r rclone:onedrive_ohm:/backup/docs \ -# --password-command "cat $HOME/Documents/__wichtig__/passwords/restic_onedrive_ohm" \ -# backup --exclude .cache --exclude-caches $backup_path - - restic "${myrestic[@]}" backup --exclude .cache --exclude-caches $backup_path -done diff --git a/run_docker_in_vm.vagrantfile b/run_docker_in_vm.vagrantfile new file mode 100644 index 0000000000000000000000000000000000000000..1d7fe86c61b90588d3aa1d90627125cb83596bac --- /dev/null +++ b/run_docker_in_vm.vagrantfile @@ -0,0 +1 @@ +#!/usr/bin/env vagrant diff --git a/virtual_audio.sh b/virtual_audio.sh new file mode 100755 index 0000000000000000000000000000000000000000..39b496102c2e9e6b2a50fdcc0fa6660e34ad3889 --- /dev/null +++ b/virtual_audio.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +pacmd load-module module-null-sink sink_name=MySink +pacmd update-sink-proplist MySink device.description=MySink +pacmd update-source-proplist "MySink.monitor" device.description="\"MySink Monitor\"" + +pacmd load-module module-loopback source=MySink.monitor sink=alsa_output.usb-Kingston_HyperX_Cloud_II_Wireless_000000000001-00.analog-stereo + +# pacmd load-module module-loopback sink=MySink source=alsa_input.usb-Kingston_HyperX_Cloud_II_Wireless_000000000001-00.mono-fallback diff --git a/vpn_uni.sh b/vpn_uni.sh index b3fc2afd0edb902ec22cf41c9d5f8bef5468e781..52380c7c7137df18df50ba7fa7ddd2d590cce895 100755 --- a/vpn_uni.sh +++ b/vpn_uni.sh @@ -5,15 +5,16 @@ VPN_PASSWORD_FILE=$(dirname $0)/pws/vpn_uni #VPN_PASSWORD_FILE=/home/ra1n/scripts/pws/vpn_uni VPN_SERVER=vpn.ohmportal.de +_uid=1000 echo $(dirname $0) args=( # set protocol to globalprotect - probably don't change this --protocol=gp # drop privs after connect - --setuid=$UID + --setuid=$_uid # drop privs during vpn script - --csd-user=$UID + --csd-user=$_uid # vpn user name -u $VPN_USER