Skip to content

Commit

Permalink
add more scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
wizzdom committed Mar 2, 2022
1 parent 84368e7 commit b8baa8a
Show file tree
Hide file tree
Showing 12 changed files with 136 additions and 5 deletions.
Empty file modified fetchcord.sh
100644 → 100755
Empty file.
60 changes: 60 additions & 0 deletions flac2mp3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash
# FLAC to MP3 converter script originally by
# erdnuesse https://github.com/erdnuesse
# adapted for use by me
## - The IFS takes care of spaces in file and dirnames
## - your folders may vary
## - what you mount to the folders does not matter
## - in RELDIR, the f5 most likely MUST be edited,
## since its responsible, how many leading directories
## will be removed from the directory structure in order
## to append that exact path to the outfile
## - the commented echos are still in place in order to give
## you the variables for testing, before running.
## just comment the ffmpeg / avconv command with a #
## - on my raspberry I could only use avconv, not ffmpeg.
## choose, whatever suits you best

IFS=$'\n'

## the paths given here contain my Directory structure, that I want to keep
## source=/mnt/music/FLAC/ARTIST/ALBUM/FLACFILE.flac
## local=/mnt/1tb/mp3/ARTIST/ALBUM/MP3FILE.mp3

source=$HOME/Music/
dest=$HOME/Music/Mobile

for i in $(find $source -type f -iname '*.flac' );
do
## SET VARIABLES for PATHS and FILENAMES
fullfile=$i
filename="${i##*/}"
filename="${filename%.*}.mp3"
fulldir=$(dirname "${i}")
reldir="$(echo $fulldir | cut -d'/' -f5-)"
reldir=${reldir//flac}
outdir="$dest/$reldir"
outfile="$outdir/$filename"

# is that working?
# outfile='$local/""$(echo $(dirname "${i}") | cut -d'/' -f5-)"//flac"/"${i##*/}"'
# echo 'output file: ' "$outfile"

## SHOW ME THE CONTENTS of the VARIABLES
# echo 'File found:' "$i"
# echo 'Relative dir: ' "$reldir"
# echo 'directory will be created: ' "$outdir"
# echo 'Filename: ' "$filename"
# echo 'FileExt: ' "$extension"
# echo 'output file: ' "$outfile"

## CREATE Output Folders
mkdir -p "$outdir"

## RUN
ffmpeg -n -loglevel info -i "$fullfile" -codec:a libmp3lame -qscale:a 0 "$outfile"
# avconv -n -nostats -loglevel info -i "$fullfile" -codec:a libmp3lame -qscale:a 0 "$outfile"
## just for testing
# sleep 1
done

4 changes: 3 additions & 1 deletion keymap.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/bin/sh
setxkbmap ie -option "caps:swapescape"
sudo localectl --no-convert set-x11-keymap ie
# swap caps & escape:
# setxkbmap ie -option "caps:swapescape"
14 changes: 14 additions & 0 deletions lineage4microg-build-surya-OFFICIAL.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
docker run \
-e "BRANCH_NAME=lineage-18.1" \
-e "DEVICE_LIST=surya" \
-e "SIGN_BUILDS=true" \
-e "SIGNATURE_SPOOFING=restricted" \
-e "CUSTOM_PACKAGES=GmsCore GsfProxy FakeStore MozillaNlpBackend NominatimNlpBackend com.google.android.maps.jar FDroid FDroidPrivilegedExtension " \
-v "/mnt/storage/lineageos4microg/lineage:/srv/src" \
-v "/mnt/storage/lineageos4microg/zips:/srv/zips" \
-v "/mnt/storage/lineageos4microg/logs:/srv/logs" \
-v "/mnt/storage/lineageos4microg/ccache:/srv/ccache" \
-v "/home/wizzdom/keys:/srv/keys" \
-v "/mnt/storage/lineageos4microg/manifests:/srv/local_manifests" \
lineageos4microg/docker-lineage-cicd

14 changes: 14 additions & 0 deletions lineage4microg-build-surya_gardiol.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
docker run \
-e "BRANCH_NAME=lineage-18.1" \
-e "DEVICE_LIST=surya" \
-e "SIGN_BUILDS=true" \
-e "SIGNATURE_SPOOFING=restricted" \
-e "CUSTOM_PACKAGES=GmsCore GsfProxy FakeStore MozillaNlpBackend NominatimNlpBackend com.google.android.maps.jar FDroid FDroidPrivilegedExtension " \
-v "/mnt/storage/lineageos4microg/lineage:/srv/src" \
-v "/mnt/storage/lineageos4microg/zips:/srv/zips" \
-v "/mnt/storage/lineageos4microg/logs:/srv/logs" \
-v "/mnt/storage/lineageos4microg/ccache:/srv/ccache" \
-v "/home/wizzdom/keys:/srv/keys" \
-v "/mnt/storage/lineageos4microg/manifests:/srv/local_manifests" \
lineageos4microg/docker-lineage-cicd

14 changes: 14 additions & 0 deletions lineage4microg-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
docker run \
-e "BRANCH_NAME=lineage-18.1" \
-e "DEVICE_LIST=surya" \
-e "SIGN_BUILDS=true" \
-e "SIGNATURE_SPOOFING=restricted" \
-e "CUSTOM_PACKAGES=GmsCore GsfProxy FakeStore MozillaNlpBackend NominatimNlpBackend com.google.android.maps.jar FDroid FDroidPrivilegedExtension " \
-v "/mnt/storage/lineageos4microg/lineage:/srv/src" \
-v "/mnt/storage/lineageos4microg/zips:/srv/zips" \
-v "/mnt/storage/lineageos4microg/logs:/srv/logs" \
-v "/mnt/storage/lineageos4microg/ccache:/srv/ccache" \
-v "/home/wizzdom/keys:/srv/keys" \
-v "/mnt/storage/lineageos4microg/manifests:/srv/local_manifests" \
lineageos4microg/docker-lineage-cicd

8 changes: 8 additions & 0 deletions nvidia-oc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Enable Overclock and cooling options using coolbits:
sudo nvidia-xconfig --cool-bits=28

# Raise GPU's TDP (power) limit to max:
sudo nvidia-smi -pl 75

# Apply GPU clocks from /etc/nvoc.d/gpu0.conf :
nvoc --apply
4 changes: 4 additions & 0 deletions osu-rpc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
export WINEESYNC=1
export WINEPREFIX=/mnt/storage/Games/osu
/opt/wine-osu/bin/wine /opt/wine-discord-ipc-bridge/winediscordipcbridge.exe
4 changes: 2 additions & 2 deletions refresh.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#!/bin/bash
killall pulseaudio
killall mpd
$HOME/.config/screenlayout/laptop-upstairs-docked.sh
# $HOME/.config/screenlayout/laptop-upstairs-docked.sh
pulseaudio &
mpd &
2 changes: 0 additions & 2 deletions screenlayout.sh

This file was deleted.

13 changes: 13 additions & 0 deletions start-virtual-cam.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
LABEL="Virtual Cam"
NOHUP=1
sudo modprobe v4l2loopback video_nr=5 card_label="$LABEL" exclusive_caps=1
if [ $NOHUP = 1 ];
then
nohup ffmpeg -i /dev/video0 -f v4l2 -vcodec rawvideo -pix_fmt yuv420p /dev/video5 &
elif [ $NOHUP = 0 ]
then
ffmpeg -i /dev/video0 -f v4l2 -vcodec rawvideo -pix_fmt yuv420p /dev/video5
else
echo "Error: incorrect NOHUP value"
fi
4 changes: 4 additions & 0 deletions ytplay
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

query=$(printf '%s' "$*" | tr ' ' '+')
mpv https://youtube.com/$(curl -s "https://vid.puffyan.us/search?q=$query" | grep -Eo "watch\?v=.{11}" | head -n 1)

0 comments on commit b8baa8a

Please sign in to comment.