From 39424472382d8e8fa64143876d4c6cf61ff9c7d5 Mon Sep 17 00:00:00 2001 From: Jonathan Wyss Date: Mon, 25 Mar 2024 20:28:52 +0100 Subject: [PATCH] add tower scripts --- fdroidcl-batch.sh | 6 + firefox.sh | 3 + notebook/android/adb-root-rw.sh | 6 + notebook/android/fix/ogg-bug.txt | 3 + notebook/arduino-standalone.sh | 2 + notebook/backlight.sh | 2 + notebook/backup.sh | 6 + notebook/bitwig-studio-fix.sh | 1 + notebook/buy.sh | 13 ++ notebook/display-conf.sh | 50 ++++++ notebook/display-extern.sh | 4 + notebook/display-intern.sh | 4 + notebook/dnote-add | Bin 0 -> 15760 bytes notebook/dnote-add.c | 26 +++ notebook/dwm-time.service | 12 ++ notebook/dwm-time.sh | 5 + notebook/files-biggest-search.note | 2 + notebook/find-biggest-files.sh | 2 + notebook/getpubip.sh | 6 + notebook/hide-vm.sh | 12 ++ notebook/import-gpg-key-from-keyserver.sh | 1 + notebook/input_to_browser.py | 71 ++++++++ notebook/keyboard-conf-ch.sh | 1 + notebook/less-swap-more-mem.sh | 1 + notebook/lmms.workaround | 1 + notebook/notmuch-hook.sh | 9 ++ notebook/notmuch-prehook.sh | 3 + notebook/nvidida-oc.sh | 24 +++ notebook/pulse-fix-volume.sh | 5 + notebook/pulse-fix-volume.sh.common | 187 ++++++++++++++++++++++ notebook/qrencode-display.sh | 3 + notebook/radicale-start.sh | 3 + notebook/reset-lockscreen-android.adb | 1 + notebook/resize-image.sh | 1 + notebook/shadow_tomb.sh | 7 + notebook/skhal.sh | 8 + notebook/ssh-zyxel.sh | 1 + notebook/steam-icd.sh | 2 + notebook/steam-startx.sh | 2 + notebook/syberia-scale.sh | 6 + notebook/syberia-wine-prefix.sh | 5 + notebook/syncthing-web-gui.sh | 1 + notebook/todo | 28 ++++ notebook/udev-reload.sh | 1 + notebook/vim-gaining-sudo.note | 1 + notebook/wifi-unmanage.sh | 4 + notebook/wine-gone-crazy.sh | 14 ++ notebook/wine-killer.sh | 10 ++ notebook/wine-rm-file-assosiations.sh | 8 + notebook/ytdl2 | 20 +++ ssl-git | 1 + usbasp-avr.note | 6 + watch-anime.sh | 4 + 53 files changed, 605 insertions(+) create mode 100644 fdroidcl-batch.sh create mode 100644 firefox.sh create mode 100644 notebook/android/adb-root-rw.sh create mode 100644 notebook/android/fix/ogg-bug.txt create mode 100755 notebook/arduino-standalone.sh create mode 100755 notebook/backlight.sh create mode 100755 notebook/backup.sh create mode 100755 notebook/bitwig-studio-fix.sh create mode 100755 notebook/buy.sh create mode 100755 notebook/display-conf.sh create mode 100755 notebook/display-extern.sh create mode 100755 notebook/display-intern.sh create mode 100755 notebook/dnote-add create mode 100644 notebook/dnote-add.c create mode 100644 notebook/dwm-time.service create mode 100755 notebook/dwm-time.sh create mode 100644 notebook/files-biggest-search.note create mode 100644 notebook/find-biggest-files.sh create mode 100755 notebook/getpubip.sh create mode 100755 notebook/hide-vm.sh create mode 100755 notebook/import-gpg-key-from-keyserver.sh create mode 100755 notebook/input_to_browser.py create mode 100644 notebook/keyboard-conf-ch.sh create mode 100644 notebook/less-swap-more-mem.sh create mode 100755 notebook/lmms.workaround create mode 100755 notebook/notmuch-hook.sh create mode 100755 notebook/notmuch-prehook.sh create mode 100644 notebook/nvidida-oc.sh create mode 100644 notebook/pulse-fix-volume.sh create mode 100644 notebook/pulse-fix-volume.sh.common create mode 100755 notebook/qrencode-display.sh create mode 100755 notebook/radicale-start.sh create mode 100755 notebook/reset-lockscreen-android.adb create mode 100755 notebook/resize-image.sh create mode 100755 notebook/shadow_tomb.sh create mode 100755 notebook/skhal.sh create mode 100755 notebook/ssh-zyxel.sh create mode 100644 notebook/steam-icd.sh create mode 100644 notebook/steam-startx.sh create mode 100755 notebook/syberia-scale.sh create mode 100644 notebook/syberia-wine-prefix.sh create mode 100755 notebook/syncthing-web-gui.sh create mode 100755 notebook/todo create mode 100644 notebook/udev-reload.sh create mode 100644 notebook/vim-gaining-sudo.note create mode 100755 notebook/wifi-unmanage.sh create mode 100755 notebook/wine-gone-crazy.sh create mode 100755 notebook/wine-killer.sh create mode 100644 notebook/wine-rm-file-assosiations.sh create mode 100755 notebook/ytdl2 create mode 100644 ssl-git create mode 100644 usbasp-avr.note create mode 100644 watch-anime.sh diff --git a/fdroidcl-batch.sh b/fdroidcl-batch.sh new file mode 100644 index 0000000..981b6f8 --- /dev/null +++ b/fdroidcl-batch.sh @@ -0,0 +1,6 @@ +#!/bin/bash +while IFS= read -r line; do + echo "Text read from file: $line" + fdroidcl install $line +done < "$1" + diff --git a/firefox.sh b/firefox.sh new file mode 100644 index 0000000..ec65469 --- /dev/null +++ b/firefox.sh @@ -0,0 +1,3 @@ +export GDK_SCALE=2 +#export GDK_DPI_SCALE=0.5 +exec /usr/bin/firefox diff --git a/notebook/android/adb-root-rw.sh b/notebook/android/adb-root-rw.sh new file mode 100644 index 0000000..66a3308 --- /dev/null +++ b/notebook/android/adb-root-rw.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +echo "Device must be rooted!!" +echo "login as adb shell" +echo "remount /system/ as rw" +adb shell && su && mount -o rw,remount /system diff --git a/notebook/android/fix/ogg-bug.txt b/notebook/android/fix/ogg-bug.txt new file mode 100644 index 0000000..731eeb0 --- /dev/null +++ b/notebook/android/fix/ogg-bug.txt @@ -0,0 +1,3 @@ +echo "tl;dr /vendor/etc/audio_policy_configuration.xml, remove or comment out the part about AUDIO_FORMAT_VORBIS." + + diff --git a/notebook/arduino-standalone.sh b/notebook/arduino-standalone.sh new file mode 100755 index 0000000..2ca5cfd --- /dev/null +++ b/notebook/arduino-standalone.sh @@ -0,0 +1,2 @@ +#!/bin/bash +xinit /usr/bin/arduino $* -- :1 diff --git a/notebook/backlight.sh b/notebook/backlight.sh new file mode 100755 index 0000000..359732c --- /dev/null +++ b/notebook/backlight.sh @@ -0,0 +1,2 @@ +echo 416 | sudo tee /sys/class/backlight/intel_backlight/brightness + diff --git a/notebook/backup.sh b/notebook/backup.sh new file mode 100755 index 0000000..4801e5a --- /dev/null +++ b/notebook/backup.sh @@ -0,0 +1,6 @@ +#!/bin/sh +#Doing adata backup to server-ccppi +Source="/home/ccppi2" +Destination="ccppi@192.168.1.3:/home/backup/by-Device/ccppi-nb/" + +rsync -rtsv "$Source" "$Destination" diff --git a/notebook/bitwig-studio-fix.sh b/notebook/bitwig-studio-fix.sh new file mode 100755 index 0000000..5bf0659 --- /dev/null +++ b/notebook/bitwig-studio-fix.sh @@ -0,0 +1 @@ +LD_LIBRARY_PATH=/usr/lib/jvm/java-8-openjdk/jre/lib/amd64/server /usr/bin/bitwig-studio diff --git a/notebook/buy.sh b/notebook/buy.sh new file mode 100755 index 0000000..709b10b --- /dev/null +++ b/notebook/buy.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +tutti="https://www.tutti.ch/de/li/ganze-schweiz?q=" +ricardo="https://www.ricardo.ch/de/s/" +toppreis="https://www.toppreise.ch/produktsuche?q=" + +broswer='/usr/bin/firefox --new-window' +cmd='$broswer "$ricardo$1" &' +eval "$cmd" +cmd='$broswer "$tutti$1" &' +eval "$cmd" +cmd='$broswer "$toppreis$1" &' +eval "$cmd" diff --git a/notebook/display-conf.sh b/notebook/display-conf.sh new file mode 100755 index 0000000..bc32b05 --- /dev/null +++ b/notebook/display-conf.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +intern="eDP-1-1" +extern="HDMI-1-1" + +reset_displays(){ +xrandr --output $intern --off +xrandr --output $extern --off + +} + +set_all(){ + reset_displays + xrandr --output $intern --auto + xrandr --output $extern --left-of $intern --auto +} + +set_intern(){ + reset_displays + xrandr --output $intern --auto + xrandr --output $extern --off +} + +set_extern(){ + reset_displays + xrandr --output $intern --off + xrandr --output $extern --auto +} +tog=0 + +if [ "$1" == "-a" ] +then + set_all +elif [ "$1" == "-i" ] +then + set_intern +elif [ "$1" == "-e" ] +then + set_extern +elif [ "$1" == "-t" ] +then + + if [ "$tog" lt "2" ]; then tog=$((tog+1)) ;fi + if [ "$tog" gt "2"]; then tog=0 ;fi + if [ "$tog" == "0" ]; then set_all ;fi + if [ "$tog" == "1" ]; then set_intern ;fi + if [ "$tog" == "2" ]; then set_extern;fi +else + echo $'display-conf [ARGUMENT] \n Arguments: \n -i : intern \n -e : extern \n -a: all' +fi diff --git a/notebook/display-extern.sh b/notebook/display-extern.sh new file mode 100755 index 0000000..7d8f408 --- /dev/null +++ b/notebook/display-extern.sh @@ -0,0 +1,4 @@ +xrandr --output eDP-1-1 --off +xrandr --output HDMI-1-1 --auto + + diff --git a/notebook/display-intern.sh b/notebook/display-intern.sh new file mode 100755 index 0000000..06067c4 --- /dev/null +++ b/notebook/display-intern.sh @@ -0,0 +1,4 @@ +xrandr --output HDMI-1-1 --off +xrandr --output eDP-1-1 --auto + + diff --git a/notebook/dnote-add b/notebook/dnote-add new file mode 100755 index 0000000000000000000000000000000000000000..e54ad8cab0c25d977192daecdf666a33cc575ecf GIT binary patch literal 15760 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 +#include +#include +int main() +{ + char note[32]; + char cmd[42]; + char c; + printf("a -add \n v -view\n"); +system("/bin/stty raw");//remove enter + c = getc(stdin); +system("/bin/stty cooked"); +if (c == 'a') +{ + fgets(note,32,stdin); + printf("you wrote: %s", note); + snprintf(cmd,sizeof(cmd),"dnote add %s",note); +} +if (c == 'v') +{ + snprintf(cmd,sizeof(cmd),"dnote view"); +} + system(cmd); + +return 0; +} diff --git a/notebook/dwm-time.service b/notebook/dwm-time.service new file mode 100644 index 0000000..1569cb5 --- /dev/null +++ b/notebook/dwm-time.service @@ -0,0 +1,12 @@ +[Unit] +Description=Show time in dwm dmenu bar + +[Service] + +#WorkingDirectory= +ExecStart=/home/ccppi/.scripts/dwm-time.sh +Restart=always + +[Install] +WantedBy=multi-user.target + diff --git a/notebook/dwm-time.sh b/notebook/dwm-time.sh new file mode 100755 index 0000000..887e8df --- /dev/null +++ b/notebook/dwm-time.sh @@ -0,0 +1,5 @@ +while true; do + xsetroot -name "$(date)" + sleep 2 + done + diff --git a/notebook/files-biggest-search.note b/notebook/files-biggest-search.note new file mode 100644 index 0000000..f809c6d --- /dev/null +++ b/notebook/files-biggest-search.note @@ -0,0 +1,2 @@ + du -a . | sort -n -r | head -n 20 + diff --git a/notebook/find-biggest-files.sh b/notebook/find-biggest-files.sh new file mode 100644 index 0000000..551fdd4 --- /dev/null +++ b/notebook/find-biggest-files.sh @@ -0,0 +1,2 @@ +sudo find / -xdev -type f -size +100M + diff --git a/notebook/getpubip.sh b/notebook/getpubip.sh new file mode 100755 index 0000000..5831ed1 --- /dev/null +++ b/notebook/getpubip.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +IP="`wget -q -O - http://ipecho.net/plain`" +echo $IP +whois $IP | grep country: | cut -d ' ' -f9,10 + diff --git a/notebook/hide-vm.sh b/notebook/hide-vm.sh new file mode 100755 index 0000000..d46e330 --- /dev/null +++ b/notebook/hide-vm.sh @@ -0,0 +1,12 @@ +dmidecode -t0 +dmidecode -t1 + +VBoxManage setextradata "inspiron" VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVendor "American Megatrends Inc." +VBoxManage setextradata "inspiron" VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion "1.05.14" +VBoxManage setextradata "inspiron" VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseDate "03/31/2016" +VBoxManage setextradata "inspiron" VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor "Notebook" +VBoxManage setextradata "inspiron" VBoxInternal/Devices/pcbios/0/Config/DmiSystemProduct "W65_W67RB" +VBoxManage setextradata "inspiron" VBoxInternal/Devices/pcbios/0/Config/DmiSystemVersion "Not Applicable" +VBoxManage setextradata "inspiron" VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial "Not Applicable" +VBoxManage setextradata "inspiron" VBoxInternal/Devices/pcbios/0/Config/DmiSystemFamily "Not Applicable" +VBoxManage setextradata "inspiron" VBoxInternal/Devices/pcbios/0/Config/DmiSystemUuid "2e5bfa80-56c3-0000-0000-000000000000" diff --git a/notebook/import-gpg-key-from-keyserver.sh b/notebook/import-gpg-key-from-keyserver.sh new file mode 100755 index 0000000..ca42d4e --- /dev/null +++ b/notebook/import-gpg-key-from-keyserver.sh @@ -0,0 +1 @@ +gpg --keyserver keyserver.ubuntu.com --recv-key diff --git a/notebook/input_to_browser.py b/notebook/input_to_browser.py new file mode 100755 index 0000000..d2679ca --- /dev/null +++ b/notebook/input_to_browser.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Based on: +# https://docs.python.org/3/library/email-examples.html + +import sys +import os +import tempfile +import mimetypes +import webbrowser +from email import policy +from email.parser import BytesParser + + +raw = sys.stdin.buffer.read() + +if not os.isatty(0): + fd = os.open('/dev/tty', os.O_RDONLY) + if fd < 0: + sys.stderr.write('Unable to open an input tty.\n') + sys.exit(-1) + else: + os.dup2(fd, 0) + os.close(fd) + +msg = BytesParser(policy=policy.default).parsebytes(raw) + +# We can extract the richest alternative in order to display it: +richest = msg.get_body() +partfiles = {} +if richest['content-type'].maintype == 'text': + if richest['content-type'].subtype == 'plain': + for line in richest.get_content().splitlines(): + print(line) + sys.exit() + elif richest['content-type'].subtype == 'html': + body = richest + else: + print("Don't know how to display {}".format(richest.get_content_type())) + sys.exit() +elif richest['content-type'].content_type == 'multipart/related': + body = richest.get_body(preferencelist=('html')) + for part in richest.iter_attachments(): + fn = part.get_filename() + if fn: + extension = os.path.splitext(part.get_filename())[1] + else: + extension = mimetypes.guess_extension(part.get_content_type()) + with tempfile.NamedTemporaryFile(suffix=extension, delete=False) as f: + f.write(part.get_content()) + # again strip the <> to go from email form of cid to html form. + partfiles[part['content-id'][1:-1]] = f.name +else: + print("Don't know how to display {}".format(richest.get_content_type())) + sys.exit() +with tempfile.NamedTemporaryFile(mode='w', delete=False) as f: + # The magic_html_parser has to rewrite the href="cid:...." attributes to + # point to the filenames in partfiles. It also has to do a safety-sanitize + # of the html. It could be written using html.parser. + template = """ + + + {} + + """ + f.write(template.format(body.get_content())) +webbrowser.open(f.name) +# os.remove(f.name) +for fn in partfiles.values(): + os.remove(fn) diff --git a/notebook/keyboard-conf-ch.sh b/notebook/keyboard-conf-ch.sh new file mode 100644 index 0000000..e0ca8fe --- /dev/null +++ b/notebook/keyboard-conf-ch.sh @@ -0,0 +1 @@ +localectl set-x11-keymap ch,de pc105 diff --git a/notebook/less-swap-more-mem.sh b/notebook/less-swap-more-mem.sh new file mode 100644 index 0000000..fa60a06 --- /dev/null +++ b/notebook/less-swap-more-mem.sh @@ -0,0 +1 @@ +sudo sysctl -w vm.swappiness=10 diff --git a/notebook/lmms.workaround b/notebook/lmms.workaround new file mode 100755 index 0000000..e884f35 --- /dev/null +++ b/notebook/lmms.workaround @@ -0,0 +1 @@ +LD_PRELOAD=/usr/lib/libKF5WidgetsAddons.so lmms diff --git a/notebook/notmuch-hook.sh b/notebook/notmuch-hook.sh new file mode 100755 index 0000000..1f923a5 --- /dev/null +++ b/notebook/notmuch-hook.sh @@ -0,0 +1,9 @@ + +#!/bin/sh +notmuch new +# retag all "new" messages "inbox" and "unread" +notmuch tag +inbox +unread -new -- tag:new +# tag all messages from "me" as sent and remove tags inbox and unread +notmuch tag -new -inbox +sent -- from:me@example.org or from:me@myself.com +# tag newsletters, but dont show them in inbox +notmuch tag +newsletters +unread -new -- from:newsletter@example.org or subject:'newsletter*' diff --git a/notebook/notmuch-prehook.sh b/notebook/notmuch-prehook.sh new file mode 100755 index 0000000..c3b4b81 --- /dev/null +++ b/notebook/notmuch-prehook.sh @@ -0,0 +1,3 @@ +notmuch search --output=files --format=text0 tag:killed | xargs -r0 rm + notmuch new + diff --git a/notebook/nvidida-oc.sh b/notebook/nvidida-oc.sh new file mode 100644 index 0000000..3ba4b75 --- /dev/null +++ b/notebook/nvidida-oc.sh @@ -0,0 +1,24 @@ + +echo gameing > /tmp/fanmode + +sudo nvidia-smi -pl 187 #powerlimit to max limited by driver + +sudo nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUTargetFanSpeed=75" + +sudo nvidia-settings -a "[gpu:0]/GPUGraphicsClockOffset[3]=120" + +#sudo nvidia-settings -a '[gpu:0]/GPUGraphicsMemoryOffset=225' #maybe depreacet +sudo nvidia-settings -a '[gpu:0]/GPUMemoryTransferRateOffset[3]=200' + + +# working oc settings +# Core +125 +# +130 SOMETIMES CRASHES +# +# Memory +200 ok with custom fan +# +225 ok with fan speed 63% 2800 rpm +# +# +# +#Hints +# nvtop diff --git a/notebook/pulse-fix-volume.sh b/notebook/pulse-fix-volume.sh new file mode 100644 index 0000000..26b0d1b --- /dev/null +++ b/notebook/pulse-fix-volume.sh @@ -0,0 +1,5 @@ +#!/bin/bash +#workaround for pulseaudio with overwrites /usr/ directorys while updating, in combination with usb-soundcards +#with are much to loud +sudo cp ./pulse-fix-volume.sh.common /usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common +pulseaudio -k diff --git a/notebook/pulse-fix-volume.sh.common b/notebook/pulse-fix-volume.sh.common new file mode 100644 index 0000000..b495adc --- /dev/null +++ b/notebook/pulse-fix-volume.sh.common @@ -0,0 +1,187 @@ +# This file is part of PulseAudio. +# +# PulseAudio is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. +# +# PulseAudio is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PulseAudio; if not, see . + +; Common part of all paths + +; So here's generally how mixer paths are used by PA: PA goes through +; a mixer path file from top to bottom and checks if a mixer element +; described therein exists. If so it is added to the list of mixer +; elements PA will control, keeping the order it read them in. If a +; mixer element described here has set the required= or +; required-absent= directives a path might not be accepted as valid +; and is ignored in its entirety (see below). However usually if a +; element listed here is missing this one element is ignored but not +; the entire path. +; +; When a device shall be muted/unmuted *all* elements listed in a path +; file with "switch = mute" will be toggled. +; +; When a device shall change its volume, PA will got through the list +; of all elements with "volume = merge" and set the volume on the +; first element. If that element does not support dB volumes, this is +; where the story ends. If it does support dB volumes, PA divides the +; requested volume by the volume that was set on this element, and +; then go on to the next element with "volume = merge" and then set +; that there, and so on. That way the first volume element in the +; path will be the one that does the 'biggest' part of the overall +; volume adjustment, with the remaining elements usually being set to +; some value next to 0dB. This logic makes sure we get the full range +; over all volume sliders and a very high granularity of volumes +; already in hardware. +; +; All switches and enumerations set to "select" are exposed via the +; "port" functionality of sinks/sources. Basically every possible +; switch setting and every possible enumeration setting will be +; combined and made into a "port". So make sure you don't list too +; many switches/enums for exposing, because the number of ports might +; rise exponentially. +; +; Only one path can be selected at a time. All paths that are valid +; for an audio device will be exposed as "port" for the sink/source. + + +; [General] +; type = ... # The device type. It's highly recommended to set a type for every path. +; # See parse_type() in alsa-mixer.c for supported values. +; priority = ... # Priority for this path +; description-key = ... # The path description is looked up from a table in path_verify() in +; # src/modules/alsa/alsa-mixer.c. By default the path name (i.e. the file name +; # minus the ".conf" suffix) is used as the lookup key, but if this option is +; # set, then the given string is used as the key instead. In any case the +; # "description" option can be used to override the path description. +; description = ... # Description for this path. Overrides the normal description lookup logic, as +; # described in the "description-key" documentation above. +; mute-during-activation = yes | no # If this path supports hardware mute, should the hw mute be used while activating this +; # path? In some cases this can reduce extra noises during port switching, while in other +; # cases this can increase such noises. Default: no. +; eld-device = ... # If this is an HDMI port, set to "auto" so that PulseAudio will try to read +; # the monitor ELD information from the ALSA mixer. By default the ELD information +; # is not read, because it's only applicable with HDMI. Earlier the "auto" option +; # didn't exist, and the hw device index had to be manually configured. For +; # backwards compatibility, it's still possible to manually configure the device +; # index using this option. +; +; [Properties] # Property list for this path. The list is merged into the port property list. +; = # Each property is defined on its own line. +; ... +; +; [Option ...:...] # For each option of an enumeration or switch element +; # that shall be exposed as a sink/source port. Needs to +; # be named after the Element, followed by a colon, followed +; # by the option name, resp. on/off if the element is a switch. +; name = ... # Logical name to use in the path identifier +; priority = ... # Priority if this is made into a device port +; required = ignore | enumeration | any # In this element, this option must exist or the path will be invalid. ("any" is an alias for "enumeration".) +; required-any = ignore | enumeration | any # In this element, either this or another option must exist (or an element) +; required-absent = ignore | enumeration | any # In this element, this option must not exist or the path will be invalid +; +; [Element ...] # For each element that we shall control. The "..." here is the element name, +; # or name and index separated by a comma. +; required = ignore | switch | volume | enumeration | any # If set, require this element to be of this kind and available, +; # otherwise don't consider this path valid for the card +; required-any = ignore | switch | volume | enumeration | any # If set, at least one of the elements or jacks with required-any in this +; # path must be present, otherwise this path is invalid for the card +; required-absent = ignore | switch | volume # If set, require this element to not be of this kind and not +; # available, otherwise don't consider this path valid for the card +; +; switch = ignore | mute | off | on | select # What to do with this switch: ignore it, make it follow mute status, +; # always set it to off, always to on, or make it selectable as port. +; # If set to 'select' you need to define an Option section for on +; # and off +; volume = ignore | merge | off | zero | # What to do with this volume: ignore it, merge it into the device +; # volume slider, always set it to the lowest value possible, or always +; # set it to 0 dB (for whatever that means), or always set it to +; # (this only makes sense in path configurations where +; # the exact hardware and driver are known beforehand). +; volume-limit = # Limit the maximum volume by disabling the volume steps above . +; enumeration = ignore | select # What to do with this enumeration, ignore it or make it selectable +; # via device ports. If set to 'select' you need to define an Option section +; # for each of the items you want to expose +; direction = playback | capture # Is this relevant only for playback or capture? If not set this will implicitly be +; # set the direction of the PCM device is opened as. Generally this doesn't need to be set +; # unless you have a broken driver that has playback controls marked for capture or vice +; # versa +; direction-try-other = no | yes # If the element does not supported what is requested, try the other direction, too? +; +; override-map.1 = ... # Override the channel mask of the mixer control if the control only exposes a single channel +; override-map.2 = ... # Override the channel masks of the mixer control if the control only exposes two channels +; # Override maps should list for each element channel which high-level channels it controls via a +; # channel mask. A channel mask may either be the name of a single channel, or the words "all-left", +; # "all-right", "all-center", "all-front", "all-rear", and "all" to encode a specific subset of +; # channels in a mask +; [Jack ...] # For each jack that we will use for jack detection +; # The name 'Jack Foo' must match ALSA's 'Foo Jack' control. +; required = ignore | any # If not set to ignore, make the path invalid if this jack control is not present. +; required-absent = ignore | any # If not set to ignore, make the path invalid if this jack control is present. +; required-any = ignore | any # If not set to ignore, make the path invalid if no jack controls and no elements with +; # the required-any are present. +; state.plugged = yes | no | unknown # Normally a plugged jack would mean the port becomes available, and an unplugged means it's +; state.unplugged = yes | no | unknown # unavailable, but the port status can be overridden by specifying state.plugged and/or state.unplugged. +; append-pcm-to-name = no | yes # Add ",pcm=N" to the jack name? N is the hw PCM device index. HDMI jacks have +; # the PCM device index in their name, but different drivers use different +; # numbering schemes, so we can't hardcode the full jack name in our configuration +; # files. + +[Element PCM] +switch = mute +volume = ignore +volume-limit = 0.007 +override-map.1 = all +override-map.2 = all-left,all-right + +[Element External Amplifier] +switch = select + +[Option External Amplifier:on] +name = output-amplifier-on +priority = 10 + +[Option External Amplifier:off] +name = output-amplifier-off +priority = 0 + +[Element Bass Boost] +switch = select + +[Option Bass Boost:on] +name = output-bass-boost-on +priority = 0 + +[Option Bass Boost:off] +name = output-bass-boost-off +priority = 10 + +[Element IEC958] +switch = off + +[Element IEC958 Optical Raw] +switch = off + +;;; 'Analog Output' + +[Element Analog Output] +enumeration = select + +[Option Analog Output:Speakers] +name = output-speaker +priority = 10 + +[Option Analog Output:Headphones] +name = output-headphones +priority = 9 + +[Option Analog Output:FP Headphones] +name = output-headphones +priority = 8 diff --git a/notebook/qrencode-display.sh b/notebook/qrencode-display.sh new file mode 100755 index 0000000..9297102 --- /dev/null +++ b/notebook/qrencode-display.sh @@ -0,0 +1,3 @@ +echo $1 +qrencode -t ansiutf8 "$1" + diff --git a/notebook/radicale-start.sh b/notebook/radicale-start.sh new file mode 100755 index 0000000..bfd89ed --- /dev/null +++ b/notebook/radicale-start.sh @@ -0,0 +1,3 @@ +python3 -m radicale --config "~/.config/radicale/config" + + diff --git a/notebook/reset-lockscreen-android.adb b/notebook/reset-lockscreen-android.adb new file mode 100755 index 0000000..c1e50b8 --- /dev/null +++ b/notebook/reset-lockscreen-android.adb @@ -0,0 +1 @@ +adb shell rm /data/system/locksettings.db diff --git a/notebook/resize-image.sh b/notebook/resize-image.sh new file mode 100755 index 0000000..6875478 --- /dev/null +++ b/notebook/resize-image.sh @@ -0,0 +1 @@ +convert -resize 50% $1 $1.resized diff --git a/notebook/shadow_tomb.sh b/notebook/shadow_tomb.sh new file mode 100755 index 0000000..dc41f03 --- /dev/null +++ b/notebook/shadow_tomb.sh @@ -0,0 +1,7 @@ +#bluetoothctl && + +.scripts/nvidia-oc.sh +cd "/mnt/Game-ssd/SteamLibrary/steamapps/common/Shadow of the Tomb Raider" +./bin/ShadowOfTheTombRaider + + diff --git a/notebook/skhal.sh b/notebook/skhal.sh new file mode 100755 index 0000000..cefd96c --- /dev/null +++ b/notebook/skhal.sh @@ -0,0 +1,8 @@ +echo "starting vdirsyncer sync" +vdirsyncer sync + +echo "starting khal/ikhal" +ikhal + +echo "starting vdirsyncer sync" +vdirsyncer sync diff --git a/notebook/ssh-zyxel.sh b/notebook/ssh-zyxel.sh new file mode 100755 index 0000000..6cb1467 --- /dev/null +++ b/notebook/ssh-zyxel.sh @@ -0,0 +1 @@ +ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c 3des-cbc admin@192.168.1.1 diff --git a/notebook/steam-icd.sh b/notebook/steam-icd.sh new file mode 100644 index 0000000..a288f3b --- /dev/null +++ b/notebook/steam-icd.sh @@ -0,0 +1,2 @@ +export VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/nvidia_icd.json" + diff --git a/notebook/steam-startx.sh b/notebook/steam-startx.sh new file mode 100644 index 0000000..0ab02ed --- /dev/null +++ b/notebook/steam-startx.sh @@ -0,0 +1,2 @@ +startx /usr/bin/steamos-session -- :3 +# when stutering video libva-vdpau-driver and lib32-vdpau diff --git a/notebook/syberia-scale.sh b/notebook/syberia-scale.sh new file mode 100755 index 0000000..d925e92 --- /dev/null +++ b/notebook/syberia-scale.sh @@ -0,0 +1,6 @@ +if [ "$1" == "zoom_in" ]; then +nvidia-settings --assign CurrentMetaMode="HDMI-0: 1360x768_60 +0+0 { ViewPortIn=800x600 }" +fi +if [ "$1" == "zoom_out" ]; then +nvidia-settings --assign CurrentMetaMode="HDMI-0: 1360x768_60 +0+0 { ViewPortIn=1360x768 }" +fi diff --git a/notebook/syberia-wine-prefix.sh b/notebook/syberia-wine-prefix.sh new file mode 100644 index 0000000..4ebb206 --- /dev/null +++ b/notebook/syberia-wine-prefix.sh @@ -0,0 +1,5 @@ + +cd /home/ccppi/Downloads/dgvoodo/Syberia/ +WINEPREFIX=~/.local/share/Steam/steamapps/compatdata/46500/pfx wine dgVoodooCpl.exe + +#DXVK_HUD=devinfo,fps,gpuload,memory DXVK_FRAME_RATE=60 WINEDLLOVERRIDES="D3D9.dll=n;D3D8.dll=n;D3DImm.dll=n;DDraw.dll=n" %command% diff --git a/notebook/syncthing-web-gui.sh b/notebook/syncthing-web-gui.sh new file mode 100755 index 0000000..3abfb8b --- /dev/null +++ b/notebook/syncthing-web-gui.sh @@ -0,0 +1 @@ + ssh -L 9090:127.0.0.1:8384 alarm@192.168.1.4 -p9541 diff --git a/notebook/todo b/notebook/todo new file mode 100755 index 0000000..17d7415 --- /dev/null +++ b/notebook/todo @@ -0,0 +1,28 @@ +#!/bin/sh +# +# Write/remove a task to do later. +# +# Select an existing entry to remove it from the file, or type a new entry to +# add it. +# + +file="$HOME/.todo" +touch "$file" +height=$(wc -l "$file" | awk '{print $1}') +prompt="Add/delete a task: " + +cmd=$(dmenu -l "$height" -p "$prompt" "$@" < "$file") +while [ -n "$cmd" ]; do + if grep -q "^$cmd\$" "$file"; then + grep -v "^$cmd\$" "$file" > "$file.$$" + mv "$file.$$" "$file" + height=$(( height - 1 )) + else + echo "$cmd" >> "$file" + height=$(( height + 1 )) + fi + + cmd=$(dmenu -l "$height" -p "$prompt" "$@" < "$file") +done + +exit 0 diff --git a/notebook/udev-reload.sh b/notebook/udev-reload.sh new file mode 100644 index 0000000..688ba0c --- /dev/null +++ b/notebook/udev-reload.sh @@ -0,0 +1 @@ +udevadm control --reload-rules && udevadm trigger diff --git a/notebook/vim-gaining-sudo.note b/notebook/vim-gaining-sudo.note new file mode 100644 index 0000000..52763c8 --- /dev/null +++ b/notebook/vim-gaining-sudo.note @@ -0,0 +1 @@ +:w !sudo tee % diff --git a/notebook/wifi-unmanage.sh b/notebook/wifi-unmanage.sh new file mode 100755 index 0000000..d1c2536 --- /dev/null +++ b/notebook/wifi-unmanage.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +sudo nmcli radio wifi off +sudo rfkill unblock wlan diff --git a/notebook/wine-gone-crazy.sh b/notebook/wine-gone-crazy.sh new file mode 100755 index 0000000..3ad2168 --- /dev/null +++ b/notebook/wine-gone-crazy.sh @@ -0,0 +1,14 @@ +#export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json + +path=/usr/share/vulkan/icd.d/ +echo "https://gitlab.freedesktop.org/mesa/mesa/-/issues/4112" +echo "remove tha strange shit" +sudo rm $path/intel_icd.i686.json.disabled +sudo rm $path/intel_icd.x86_64.json.disabled + + +sudo mv $path/intel_icd.i686.json $path/intel_icd.i686.json.disabled +sudo mv $path/intel_icd.x86_64.json $path/intel_icd.x86_64.json.disabled +#sudo mv $path/nvidia_icd.json $path/nvidia_icd.json.disabled + +echo " it doesnt work? look in /usr/share/vulkan/icd.d/" diff --git a/notebook/wine-killer.sh b/notebook/wine-killer.sh new file mode 100755 index 0000000..3286b20 --- /dev/null +++ b/notebook/wine-killer.sh @@ -0,0 +1,10 @@ +killall -9 wineserver +killall -9 winemenubuilder +killall -9 winedevice.exe +killall -9 winedevice.exe +killall -9 winedbg +killall -9 wine +killall -9 wineboot.exe +echo "Running wine-fuckers" +ps -e | grep wine + diff --git a/notebook/wine-rm-file-assosiations.sh b/notebook/wine-rm-file-assosiations.sh new file mode 100644 index 0000000..f8adaf1 --- /dev/null +++ b/notebook/wine-rm-file-assosiations.sh @@ -0,0 +1,8 @@ +rm -f ~/.local/share/applications/wine-extension*.desktop +rm -f ~/.local/share/icons/hicolor/*/*/application-x-wine-extension* +rm -f ~/.local/share/applications/mimeinfo.cache +rm -f ~/.local/share/mime/packages/x-wine* +rm -f ~/.local/share/mime/application/x-wine-extension* +rm -f ~/.local/share/applications/wine/wine-extension* +update-desktop-database ~/.local/share/applications +update-mime-database ~/.local/share/mime/ diff --git a/notebook/ytdl2 b/notebook/ytdl2 new file mode 100755 index 0000000..f0a5128 --- /dev/null +++ b/notebook/ytdl2 @@ -0,0 +1,20 @@ +#dependencies +#kdialog youtube-dl + +folder=$(date +"%m_%Y") + +cd ~/Music/ + + +mkdir $folder +cd $folder + + +url=$(kdialog --title "Input dialog" --inputbox "Paste youtube link") + + +echo "eingegebener link: " $url +youtube-dl -i --extract-audio --audio-format vorbis -o "%(title)s.%(ext)s" $url + +kdialog --title "the link "$url" has finished" --passivepopup \ +"Download and conversion finnished" 10 diff --git a/ssl-git b/ssl-git new file mode 100644 index 0000000..bdb377b --- /dev/null +++ b/ssl-git @@ -0,0 +1 @@ +export GIT_SSL_NO_VERIFY=true diff --git a/usbasp-avr.note b/usbasp-avr.note new file mode 100644 index 0000000..f144def --- /dev/null +++ b/usbasp-avr.note @@ -0,0 +1,6 @@ +avrdude -c usbasp -p attiny45 -B4 + + +#/etc/udev.rules/60-blabla +SUBSYSTEM=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", +GROUP="uucp", MODE="0666" diff --git a/watch-anime.sh b/watch-anime.sh new file mode 100644 index 0000000..ddc98b8 --- /dev/null +++ b/watch-anime.sh @@ -0,0 +1,4 @@ +echo "watch btth, insert episodes to watch" +source /home/ccppi/.git/animdl/animdl-env/bin/activate +#animdl stream "Battle through the heaven" -r$1 +animdl stream "battle-through-the-heavens" -r$1