Merge from X250

This commit is contained in:
2024-08-30 09:44:33 +02:00
commit 49437aa167
68 changed files with 736 additions and 0 deletions
Executable
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
a='google.com/search?q='
c=$a$1
echo searching!
echo $c
elinks -dump --no-numbering --no-references $c | sed -n '/[0-9]\./,+2p'
Symlink
+1
View File
@@ -0,0 +1 @@
/home/kof/src/PerlinNet/PerlinNet
Executable
BIN
View File
Binary file not shown.
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
cd ~/.wine/drive_c/Program\ Files\ \(x86\)/GameTop.com/Sudden\ Strike\ 2/Run/
wine game_exe.exe
Executable
BIN
View File
Binary file not shown.
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
echo 1 > /tmp/signal
Executable
BIN
View File
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
echo "main(t){for(t=0;;t++)putchar(((t*t+t)>>t/5000)|t*t);}" | gcc -x c - -lm -o /tmp/bytebeat && /tmp/bytebeat | ffmpeg -f rawvideo -pix_fmt gray -s 64x36 -i - -f s16le -ar 8000 -ac 2 -i - -vf "[in]fade=in:0:50[a],[a]fade=out:3300:300[b],[b]scale=1280:720[out]" -af "[in]afade=t=in:ss=0:d=2[a],[a]afade=t=out:st=110:d=10[out]" -c:v libx264 -b:v 6M -r 30 -c:a aac -strict -2 -ar 44100 -b:a 128k -t 120 -y ~/render/byteBeat.mp4
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
xdotool click 1
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
date +%s_%Y_%m_%d_W%V_kof%y.scd
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
echo `date +%H:%M:%S:0.%N | awk -F "[d :]" '{printf "%.10f", (($1*3600)+($2*60)+($3)+($4))/86400.0 }'`
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
echo "$*" | tr '[:lower:]' '[:upper:]' | awk -F ',' '{print $1","$2}' | tr ' ' '_' | recode -f utf8..flat | tr ',' ' ' | awk '{print $1" "$2}' | tr '[:lower:]' '[:upper:]'
#echo "$*" | tr '[:lower:]' '[:upper:]' | tr '[:upper:]' '[:lower:]' | tr 'ě' 'e' | tr 'š' 's' | tr 'č' 'c' | tr 'ř' 'r' | tr 'ž' 'z' | tr 'ý' 'y' | tr 'á' 'a' | tr 'í' 'i' | tr 'é' 'i' | tr 'ú' 'u' | tr 'ů' 'u' | tr ' ' '_' | tr '[:lower:]' '[:upper:]'
Executable
BIN
View File
Binary file not shown.
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
sudo modprobe v4l2loopback && ffmpeg -f x11grab -r 30 -s 1024x768 -i :0.0+1600,0 -vcodec rawvideo -pix_fmt yuv420p -threads 1 -f v4l2 /dev/video1
Executable
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
Start=`frac "$2" "$4"` #`echo "$2" | sed 's/.\{2\}/&:/g' | head -c 8`
End=`frac "$3" "$4"` #`echo "$3" | sed 's/.\{2\}/&:/g' | head -c 8`
IN="$2" #`echo "$2" | sed 's/.\{2\}/&:/g' | head -c 8`
OUT="$3" #`echo "$3" | sed 's/.\{2\}/&:/g' | head -c 8`
#Len=`date -u -d "0 $Duration sec - $Start sec" +"%H:%M:%S"`
Len=`echo "$(date -u -d@"$(( ($(date -u -d"$End" +%s%N) - $(date -u -d"$Start" +%s%N))/1000000000 ))" +%H:%M:%S)"."$(( ($(date -u -d"$End" +%s%N) - $(date -u -d"$Start" +%s%N))%1000000000/1000000 ))"`
echo getting $Len of "$1"
ffmpeg -ss "$Start" -i "$1" -t "$Len" -c:v copy -c:a copy "`basename -s .mov $1`"_`echo $IN | tr ':' '-'`_`echo $OUT | tr ':' '-'`_FRAGMENT.mov
Executable
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
echo "Kryštof Pešek" > /home/kof/.signature
echo "https://k0f.github.io" >> /home/kof/.signature
echo "https://k-o-l-e-k-t-i-v.github.io" >> /home/kof/.signature
echo "----------------------------------------------------" >> /home/kof/.signature
echo Unix epoch : `date +%s` >> /home/kof/.signature
echo Metric time: `/home/kof/bin/metriclock` >> /home/kof/.signature
echo Moon phase : `/home/kof/bin/moonphase` >> /home/kof/.signature
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
stat "$1" 2>/dev/null | grep Modify | awk '{print $2}'
+54
View File
@@ -0,0 +1,54 @@
#!/bin/bash
INPUT="$1"
DURATION=$(ffprobe -v error -select_streams v:0 -show_entries stream=duration -of default=noprint_wrappers=1:nokey=1 "$INPUT");
SECS=$(echo $DURATION | awk -F'.' '{print $1}')
FRAG=$(echo $DURATION | awk -F'.' '{print $2}')
NO_OF_SEGMENTS=$(($SECS/60))
echo total duration "$SECS.$FRAG"s
echo number of segments $NO_OF_SEGMENTS
REST=$(( $SECS % 60 )).$FRAG
MINS=0
HOS=0
rm -rf /mnt/central/TEMP_KRYSTOF/parallel/*
echo "" > /tmp/jobs
echo "" > /tmp/files
SCOUNT=0
LOOP_NO=0
while [[ $SCOUNT -le $SECS ]];
do
TIME=`printf "%02d" $HOS`:`printf "%02d" $MINS`:00
SEGMENT=60
if [ $LOOP_NO -eq $NO_OF_SEGMENTS ]
then
SEGMENT=$REST
fi
#echo $TIME $SEGMENT
OUTPUT=/tmp/$(echo `basename $INPUT` | awk -F'.' '{print $1}')_$TIME.mp4
echo "ffmpeg -loglevel panic -ss $TIME -i $INPUT -t $SEGMENT -c:v h264 -pix_fmt yuv420p -crf 22 -preset ultrafast -threads 1 -c:a aac -y $OUTPUT" >> /tmp/jobs
echo file $OUTPUT >> /tmp/files
SCOUNT=$(( SCOUNT + 60 ))
MINS=$(( $MINS + 1 ))
if [ $MINS -ge 59 ]
then
MINS=0
HOS=$(( $HOS + 1 ))
fi
LOOP_NO=$(( $LOOP_NO + 1 ))
done
#parallel --eta --progress -S "32/nfaRender,32/nfaDTL01,8/:,8/nfaProjekce,8/nfaAdela" < /tmp/jobs
#parallel --eta --progress -S "8/nfaRender,8/nfaDTL01,4/nfaAdela,8/:,8/nfaProjekce" < /tmp/jobs
#parallel --eta --progress -S "4/nfaRender,4/nfaAdela,4/:,16/nfaProjekce" < /tmp/jobs
parallel --eta --progress -S "4/:" < /tmp/jobs
FIN="$(echo `basename $INPUT` | awk -F'.' '{print $1}')".mp4
ffmpeg -f concat -safe 0 -i /tmp/files -c:v copy -c:a copy -y $FIN
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
cd /opt/hammerfight/ && optirun ./Hammerfight
Executable
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
#sudo dvgrab -format dv1 - | \
# ffmpeg2theora -a 0 -v 5 -f dv -x 320 -y 240 -o /dev/stdout - | \
# oggfwd -p -n "FAMU stream" localhost 8000 cigareta /theora.ogg
ffmpeg -re -f video4linux2 -i /dev/video0 -r 30 -f jack -ac 2 -i stream -vcodec libtheora -b:v 1280k -s 640x360 -acodec libvorbis -b:a 128k -threads 4 -f ogg - | oggfwd -p -n "Kof's stream" localhost 8000 cigareta /test.ogg
#ffmpeg -re -f video4linux2 -i /dev/video0 -r 15 -f jack -ac 2 -i test -vcodec libvpx -b:v 256k -s 480x270 -acodec libvorbis -b:a 128k -threads 4 -f webm http://localhost:8000/test
#ffmpeg -s 1280x720 -f video4linux2 -i /dev/video0 -f alsa -ac 2 -i hw:0,0 -b:a 128k -acodec libvorbis -vcodec libtheora -b:v 1000k -r 25 -threads 4 -f ogg - | oggfwd localhost 8000 cigareta /test.ogv
#dvgrab -format dv1 - | ffmpeg -s 800x600 -f dv -i - -b:a 128k -acodec libvorbis -vcodec libtheora -b:v 3M -r 25 -threads 4 -f ogg - | oggfwd -p -n "Hello world!" localhost 8000 cigareta /test.ogv
#dvgrab -format dv1 - | ffmpeg -f dv -i /dev/stdin -vcodec libtheora -r 25 -b:v 256k -s 480x270 -vf "yadif" -acodec libvorbis -b:a 128k -threads 4 -f ogg - | oggfwd -p -n "Informace" stream.iim.cz 8000 pass1234 /proud.ogv
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
melt "$@" -consumer avformat real_time=1 terminate_on_pause=0 f=ogg vcodec=libtheora b=1500k s=640x360 acodec=libvorbis aq=20 | icefwd -n "Live Stream" -d "irc.freenode.net #kolektiv" -f ogg localhost 8000 cigareta /live.ogg
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
#melt "$@" -consumer avformat real_time=1 terminate_on_pause=0 f=webm vcodec=libvpx b=1500k cpu-used=4 s=640x360 threads=4 acodec=libvorbis aq=20 | icefwd -n "Live Stream" -d "irc.freenode.net #kolektiv" -f webm localhost 8000 cigareta /live.mkv
melt "$@" -consumer avformat real_time=1 terminate_on_pause=0 s=1024x576 f=webm vcodec=libvpx b=5000k cpu-used=4 threads=4 acodec=libaac movflags="faststart" aq=20 | icefwd -n "Live Stream" -d "irc.freenode.net #kolektiv" -f webm localhost 8000 cigareta /live.mkv
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
melt ~/screen.mlt -consumer avformat real_time=1 terminate_on_pause=0 f=webm vcodec=libvpx b=2M cpu-used=4 s=1600x900 acodec=libvorbis threads=4 aq=20 | icefwd -n "Live Stream" -d "irc.freenode.net #kolektiv" -f webm localhost 8000 cigareta /live.webm
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
echo {multi,foto,nara,kombi,uni,nano,narko,neuro,kontra,filo,orto,auto,moto,elektro,atomo,algo,meteo,hyper,inter,fiber,opto,tele,gramo,mega,mikro,fono,proxy,para,pro,re,kyber,metro,techno,psycho}{aparát,text,versum,punkt,sugesce,dukt,pozice,pedie,neuron,net,fon,gram,graf,vize,pank,polis,logie,grafie,laxa,fráze,dox,sex,aktivita,procesor,signum,vitum,ton,tron,sofie,fil,mánie,fílie,fóbie,natorika,link,prostor,film,iluze,pohyb,drom,dron,heking,bending}. | sed -e 's/\./\n/g' | sort -R | espeak -vcs -s 120 -p 20
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
ffmpeg -i $@ -af loudnorm=I=-16:TP=-1.5:LRA=11:measured_I=-27.61:measured_LRA=18.06:measured_TP=-4.47:measured_thresh=-39.20:offset=0.58:linear=true:print_format=summary -ar 48k loudnorm_$@
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
#kill -9 `ps -ef | grep $1 | grep -v grep | awk '{print $2}'`
for i in `ps ax | grep "$1" | grep -v grep | awk '{print $5}'` ; do echo $i ;done ; for i in `ps ax | grep "$1" | grep -v grep | awk '{print $1}'` ; do kill -9 $i ;done
#for i in `ps aux | grep "$1" | grep -v grep | awk '{print $2}'`; do kill -9 $i || echo "No such process." ; done
Executable
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
DECIMAL=`date +%H:%M:%S:0.%N | awk -F "[d :]" '{printf "%.05f", (($1*3600)+($2*60)+($3)+($4))/86400.0 }'`
HH=`echo $DECIMAL | cut -c -3 | sed -e 's/\.//'`
MM=`echo $DECIMAL | cut -c -5 | tail -c -3`
SS=`echo $DECIMAL | cut -c -7 | tail -c -3`
echo $HH:$MM:$SS
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
mkdir $1
cd $1
micro $1.pde
Executable
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env python
"""
moonphase.py - Calculate Lunar Phase
Author: Sean B. Palmer, inamidst.com
Cf. http://en.wikipedia.org/wiki/Lunar_phase#Lunar_phase_calculation
"""
import math, decimal, datetime
dec = decimal.Decimal
def position(now=None):
if now is None:
now = datetime.datetime.now()
diff = now - datetime.datetime(2001, 1, 1)
days = dec(diff.days) + (dec(diff.seconds) / dec(86400))
lunations = dec("0.20439731") + (days * dec("0.03386319269"))
return lunations % dec(1)
def phase(pos):
index = (pos * dec(8)) + dec("0.5")
index = math.floor(index)
return {
0: "New Moon",
1: "Waxing Crescent",
2: "First Quarter",
3: "Waxing Gibbous",
4: "Full Moon",
5: "Waning Gibbous",
6: "Last Quarter",
7: "Waning Crescent"
}[int(index) & 7]
def main():
pos = position()
phasename = phase(pos)
roundedpos = round(float(pos), 3)
#print("%s (%s)" % (phasename, roundedpos))
print("%s" % (roundedpos))
if __name__=="__main__":
main()
Executable
+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/env python
"""
moonphase.py - Calculate Lunar Phase
Author: Sean B. Palmer, inamidst.com
Cf. http://en.wikipedia.org/wiki/Lunar_phase#Lunar_phase_calculation
"""
import math, decimal, datetime
dec = decimal.Decimal
def position(now=None):
if now is None:
now = datetime.datetime.now()
diff = now - datetime.datetime(2001, 1, 1)
days = dec(diff.days) + (dec(diff.seconds) / dec(86400))
lunations = dec("0.20439731") + (days * dec("0.03386319269"))
return lunations % dec(1)
def phase(pos):
index = (pos * dec(8)) + dec("0.5")
index = math.floor(index)
return {
0: "New Moon",
1: "Waxing Crescent",
2: "First Quarter",
3: "Waxing Gibbous",
4: "Full Moon",
5: "Waning Gibbous",
6: "Last Quarter",
7: "Waning Crescent"
}[int(index) & 7]
def main():
pos = position()
phasename = phase(pos)
roundedpos = round(float(pos), 3)
print "%s (%s)" % (phasename, roundedpos)
if __name__=="__main__":
main()
Executable
BIN
View File
Binary file not shown.
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
mpv --start=`date +%S.%N` "$*"
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
SECS=`echo $(date +%M)*60.0+$(date +%S.%N) | bc -l`
echo $SECS
mpv --start=$SECS "$*"
Executable
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
BPM=`mediainfo "$1" | grep BPM | head -n1 | awk '{print $3}'`
TARGET="$2"
SPEED=`echo $TARGET/$BPM | bc -l`
PITCH=`echo $BPM/$TARGET | bc -l`
echo altering tempo of track from $BPM to $TARGET that is $SPEED of original tempo
mpv --start=`date +%S.%N` --no-audio-display --af=rubberband --speed=$SPEED "$1"
#mpv --af=scaletempo=scale=$SPEED:overlap=0.5 "$1"
Executable
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
ARGS="$*"
date +%s.%N
echo `date +%s.%N` "$ARGS" >> /home/kof/src/now/log
cd /home/kof/src/now
git commit -am "`date +%s.%N`"
git pull
git push
#rsync -avzu home:Downloads ~/.
#cd ~/Downloads
#cp `ls -tr | tail -n 1` "$*"; mv "$*" ~/Pictures; cd ~/Pictures && postgen "$*"
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
xdg-open "$*" &
Executable
BIN
View File
Binary file not shown.
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
sudo cpufreq-set -g performance
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
rsync -avu home:Downloads ~/.
Executable
BIN
View File
Binary file not shown.
Executable
+2
View File
@@ -0,0 +1,2 @@
sketch=`pwd`
/home/kof/processing/processing-java --sketch=$sketch --force --run @$
Executable
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
SKETCH=`pwd`
OUTPUT=/tmp/processingMess/
killall processing-java
cd /home/kof/Downloads/processing-3.4 && primusrun ./processing-java --sketch="$SKETCH" --output=$OUTPUT --force --run
cd $SKETCH
Executable
+2
View File
@@ -0,0 +1,2 @@
sketch=`pwd`
/home/kof/processing/processing-java --sketch=$sketch --force --present @$
Symlink
+1
View File
@@ -0,0 +1 @@
/home/kof/processing/processing
Executable
+146
View File
@@ -0,0 +1,146 @@
#!/bin/sh
# MIT License
#
# Copyright (c) 2022 gentoo-btw
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# colors for tty sessions
if [ "$TERM" = "linux" ]; then
BLK='\033[0;30m'
RED='\033[0;31m'
GRN='\033[1;32m'
YEL='\033[1;33m'
BLU='\033[0;34m'
PURP='\033[0;35m'
CYN='\033[0;36m'
WHT='\033[0;37m'
else
# colors for gui
BLK='\033[0;30m'
RED='\033[0;31m'
GRN='\033[2;32m'
YEL='\033[0;33m'
BLU='\033[0;34m'
PURP='\033[0;35m'
CYN='\033[0;36m'
WHT='\033[0;37m'
fi
# blue arrow
BLUE_ARROW="$(printf "%b->%b" "${BLU}" "${WHT}")"
# sets version
RAMFETCH_VER="v1.0.2"
# help and version
if [ "$*" = "--help" ] || [ "$*" = "-h" ]; then
cat <<EOF
$BLUE_ARROW ramfetch version $RAMFETCH_VER
Usage:
--help (or -h for short) -- shows this help
--version (or -v for short) -- shows version
EOF
exit 0
fi
if [ "$*" = "--version" ] || [ "$*" = "-v" ]; then
cat <<EOF
$BLUE_ARROW ramfetch version $RAMFETCH_VER. made by gentoo-btw
https://github.com/gentoo-btw/ramfetch
EOF
exit 0
fi
# Sed input. Basically use regex to get the number + kB part and replace it itself to ensure the capture group is printed
# 's/[^0-9]*\([0-9]* kB\)/\1/'
# 's' - subsitution
# '/' - regex start
# '[^0-9]*' - match all except 0-9 zero or more times
# '\' - escape parenthesis
# '(' - capture group, everything inside will be saved as result of it
# '[0-9]*' match 0-9 zero or more times exluding unit (' kB') [unit is always kB]
# '\' - escape parenthesis
# ')' - capture group close
# ' kB' -
# '/' subsitution end, replace start
# '\1' - everything from capture group
# '/' - end replace
# Fetches memory information from /proc/meminfo
# Desired feild captured with case, sed extracts value
# numfmt converts kB to more readable format
while read -r REPLY; do
case "${REPLY}" in
(MemTotal:*) MEM_TOTAL=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\) kB/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
(MemFree:*) MEM_FREE=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\) kB/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
(MemAvailable:*) MEM_AVAILABLE=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\) kB/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
(HugePages_Free:*) HUGEPAGES_FREE=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\)/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
(HugePages_Total:*) HUGEPAGES_TOTAL=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\)/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
(Buffers:*) BUFFERS=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\) kB/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
(Cached:*) CACHED=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\) kB/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
(SwapTotal:*) SWAP_TOTAL=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\) kB/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
(SwapFree:*) SWAP_FREE=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\) kB/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
(Zswap:*) ZSWAP=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\) kB/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
(Zswapped:*) ZSWAPPED=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\) kB/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
(SwapCached:*) SWAP_CACHED=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\) kB/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
(Dirty:*) DIRTY=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\) kB/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
(KernelStack:*) KERNEL_STACK=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\) kB/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
(Percpu:*) PER_CPU=$(printf "%s" "$REPLY" | sed 's/[^0-9]*\([0-9]*\) kB/\1/' | numfmt --to=iec-i --from-unit=1024 --suffix=B --format="%9.2f" --invalid='ignore') ;;
esac
done < /proc/meminfo
# colorblocks/hostname, and the green arrow
GRN_ARROW="$(printf "%b->%b" "${GRN}" "${WHT}")"
HOSTNAME="$(hostname)"
HOST_AND_USER_LEN=$(echo ${#HOSTNAME} + ${#USER} + 1 | bc)
HOST_AND_USER="$(printf "%b%s%b%c%b%s%b" "${GRN}" "$USER" "${WHT}" "@" "${YEL}" "$HOSTNAME" "${WHT}")"
COLORBLOCKS="$(printf "%b%s%b%s%b%s%b%s%b%s%b%s%b%s%b%s%b" "${BLK}" "███" "${RED}" "███" "${GRN}" "███" "${BLU}" "███" "${YEL}" "███" "${PURP}" "███" "${CYN}" "███" "${WHT}" "███" "${WHT}")"
# for ascii logo
YELLOW_PART="$(printf "%b" "${YEL}")"
GREEN_PART="$(printf "%b" "${GRN}")"
END="$(printf "%b" "${WHT}")"
# output
cat <<EOF
$GREEN_PART ████████████████████████████ $HOST_AND_USER
$GREEN_PART ████████████████████████████████$END $(printf '%0.s-' $(seq 1 "$HOST_AND_USER_LEN"))
$GREEN_PART ████ ████ ███ ███$END RAM Total $GRN_ARROW $(printf "\t") ${MEM_TOTAL:-null}
$GREEN_PART ████ ████ ███ ███$END RAM Free $GRN_ARROW $(printf "\t") ${MEM_FREE:-null}
$GREEN_PART ████ ████ ███ ███$END RAM Available $GRN_ARROW $(printf "\t") ${MEM_AVAILABLE:-null}
$GREEN_PART ████ ████ ███ ███$END Buffers $GRN_ARROW $(printf "\t\t") ${BUFFERS:-null}
$GREEN_PART ████████████████████████████████$END Cached $GRN_ARROW $(printf "\t\t") ${CACHED:-null}
$GREEN_PART ███ ████ █████ █████ ███$END Swap Total $GRN_ARROW $(printf "\t") ${SWAP_TOTAL:-null}
$YELLOW_PART ███ ████ █████ █████ ███$END Swap Free $GRN_ARROW $(printf "\t") ${SWAP_FREE:-null}
Zswap $GRN_ARROW $(printf "\t\t") ${ZSWAP:-null}
Zswapped $GRN_ARROW $(printf "\t") ${ZSWAPPED:-null}
Swap Cached $GRN_ARROW $(printf "\t") ${SWAP_CACHED:-null}
Dirty $GRN_ARROW $(printf "\t\t") ${DIRTY:-null}
Kernel Stack $GRN_ARROW $(printf "\t") ${KERNEL_STACK:-null}
Per CPU $GRN_ARROW $(printf "\t\t") ${PER_CPU:-null}
HugePages Free $GRN_ARROW $(printf "\t") ${HUGEPAGES_FREE:-null}
HugePages Total $GRN_ARROW $(printf "\t") ${HUGEPAGES_TOTAL:-null}
$COLORBLOCKS
EOF
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
ffmpeg -t 10 -f video4linux2 -s 640x480 -r 15 -i /dev/video0 /tmp/img%05d.bmp && convert /tmp/img*.bmp -set delay 6 -loop 0 -delay 6 -dispose 1 -map ~/map.gif -ordered-dither o8x8 /tmp/out.gif && cp /tmp/out.gif ~/ && rm /tmp/img*.bmp
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
cnee --record --mouse --keyboard -o /tmp/xnee.xns -e /tmp/xnee.log --stop-key Shift_R
Executable
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
if [ -z "$1" ]; then
data="@-"
else
data=`cat $1`
fi
convert \
-font '/home/kof/.fonts/TeutonWeiss.ttf' -background black -pointsize 58 -fill '#E18A07' label:"Crypto by Kof" \
-font '/home/kof/.fonts/TeutonNormal.otf' -background black -pointsize 12 -fill '#404040' label:"message generated @ `hostname` on `date`" \
-background black -fill white -font '/home/kof/.fonts/SempliceRegular.ttf' -pointsize 8 -size 300x -encoding utf8 -gravity NorthWest caption:"$data" \
-append -flatten -set label "Crypto, fuck the robots! message by k0f" -bordercolor black -border 10 /tmp/rederedText.png
#sha=`date`_`sha1sum /tmp/rederedText.png | sed "s#[[:space:]]*/.*/.*.*##g"`
sha="`date +%d_%m_%y__%T` by `whoami`"
cp /tmp/rederedText.png /home/kof/crypto/"$sha".png
Executable
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
NAME=$1
if [ $# -eq 0 ]
then
NAME=recording
fi
(sleep 1; jack_connect SuperCollider:out_1 rec:input_1)&
(sleep 1; jack_connect SuperCollider:out_2 rec:input_2)&
ffmpeg -f jack -i rec -af "afade=t=in:ss=0:d=5" -strict -1 -y ~/recordings/`date +%s`_$NAME.flac
#echo "\\n"
#(sleep 0.1; kill -s SIGSTOP `pidof ffmpeg`; read -rsn1 -p "Press any key to start recording"; kill -s SIGCONT `pidof ffmpeg` ; read -rsn1 -p "Any key to stop it"; kill -SIGINT `pidof ffmpeg`)
Executable
+6
View File
@@ -0,0 +1,6 @@
SIZ=9
FILENAME=$(echo `basename "$1"` | awk -F'.' '{print $1}')
FRAMERATE=`ffprobe -v error -select_streams v:0 -show_entries stream=r_frame_rate -of default=noprint_wrappers=1:nokey=1 "$1" | bc -l `
ffmpeg -hwaccel auto -i "$1" -filter_complex "setsar=sar=1[sar];[sar]scale=640:-1[scale];[scale]drawtext=fontfile=/home/kof/.fonts/Monaco_Linux.ttf:x=20:y=20:box=1:boxcolor=black@0.3:boxborderw=3:fontcolor=white:fontsize=$SIZ:r=$FRAMERATE:timecode=\'00:00:00:00\'[tc];[tc]drawtext=fontfile=/home/kof/.fonts/Monaco_Linux.ttf:x=(main_w-100):y=20:fontcolor=white:fontsize=$SIZ:text=`date +%b%d\ Kof%y`" -c:v h264 -profile:v high -pix_fmt yuv420p -preset 0 -c:a aac -threads 0 -y `basename -s .mov "$FILENAME"`"_screener_tc_logo.mp4"
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
cd /home/kof/src/supercollider/kof
screen /usr/local/bin/scvim `date +%s_%Y_%m_%d_W%V_kof%y.scd`
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
echo "Coded by Kof @ " && date && echo '\n\n' && cat /home/kof/bin/signature
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
sudo ettercap -TqM ARP:REMOTE -i wlan0 // //
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
for i in 24*.wav; do mediainfo $i | grep -e "Encoded date" | awk '{print $5}'| tr -d "\n" && echo " $i" ; done > /tmp/list
cat /tmp/list | sort > /tmp/sorted
cat /tmp/sorted
Executable
+14
View File
@@ -0,0 +1,14 @@
# SAMPLE: FLAC streaming on Windows & Mac
while true
do
ffmpeg -f jack -i stream \
-ar 48000 \
-ac 2 \
-c:a opus \
-fflags +igndts \
-f ogg \
-strict -2 \
-content_type 'application/ogg' \
icecast://source:cigareta@pesek.ddns.net:8000/stream.ogg
sleep 1
done
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
ntpdate pool.ntp.org
hwclock --systohc --localtime
+53
View File
@@ -0,0 +1,53 @@
!_TAG_EXTRA_DESCRIPTION anonymous /Include tags for non-named objects like lambda/
!_TAG_EXTRA_DESCRIPTION fileScope /Include tags of file scope/
!_TAG_EXTRA_DESCRIPTION pseudo /Include pseudo tags/
!_TAG_EXTRA_DESCRIPTION subparser /Include tags generated by subparsers/
!_TAG_FIELD_DESCRIPTION epoch /the last modified time of the input file (only for F\/file kind tag)/
!_TAG_FIELD_DESCRIPTION file /File-restricted scoping/
!_TAG_FIELD_DESCRIPTION input /input file/
!_TAG_FIELD_DESCRIPTION name /tag name/
!_TAG_FIELD_DESCRIPTION pattern /pattern/
!_TAG_FIELD_DESCRIPTION typeref /Type and name of a variable or typedef/
!_TAG_FIELD_DESCRIPTION!Python nameref /the original name for the tag/
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_KIND_DESCRIPTION!Python I,namespace /name referring a module defined in other file/
!_TAG_KIND_DESCRIPTION!Python Y,unknown /name referring a class\/variable\/function\/module defined in other module/
!_TAG_KIND_DESCRIPTION!Python c,class /classes/
!_TAG_KIND_DESCRIPTION!Python f,function /functions/
!_TAG_KIND_DESCRIPTION!Python i,module /modules/
!_TAG_KIND_DESCRIPTION!Python m,member /class members/
!_TAG_KIND_DESCRIPTION!Python v,variable /variables/
!_TAG_KIND_DESCRIPTION!Sh a,alias /aliases/
!_TAG_KIND_DESCRIPTION!Sh f,function /functions/
!_TAG_KIND_DESCRIPTION!Sh h,heredoc /label for here document/
!_TAG_KIND_DESCRIPTION!Sh s,script /script files/
!_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/
!_TAG_OUTPUT_FILESEP slash /slash or backslash/
!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
!_TAG_OUTPUT_VERSION 0.0 /current.age/
!_TAG_PARSER_VERSION!Python 0.0 /current.age/
!_TAG_PARSER_VERSION!Sh 0.0 /current.age/
!_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/
!_TAG_PROC_CWD /home/kof/bin/ //
!_TAG_PROGRAM_AUTHOR Universal Ctags Team //
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
!_TAG_PROGRAM_VERSION 6.0.0 /p6.0.20221218.0/
!_TAG_ROLE_DESCRIPTION!Python!module imported /imported modules/
!_TAG_ROLE_DESCRIPTION!Python!module indirectlyImported /module imported in alternative name/
!_TAG_ROLE_DESCRIPTION!Python!module namespace /namespace from where classes\/variables\/functions are imported/
!_TAG_ROLE_DESCRIPTION!Python!unknown imported /imported from the other module/
!_TAG_ROLE_DESCRIPTION!Python!unknown indirectlyImported /classes\/variables\/functions\/modules imported in alternative name/
!_TAG_ROLE_DESCRIPTION!Sh!heredoc endmarker /end marker/
!_TAG_ROLE_DESCRIPTION!Sh!script loaded /loaded/
EOF ramfetch /^ cat <<EOF$/;" h
EOF ramfetch /^cat <<EOF$/;" h
dec moonphase /^dec = decimal.Decimal$/;" v
dec moonphase.py /^dec = decimal.Decimal$/;" v
main moonphase /^def main(): $/;" f
main moonphase.py /^def main(): $/;" f
phase moonphase /^def phase(pos): $/;" f
phase moonphase.py /^def phase(pos): $/;" f
position moonphase /^def position(now=None): $/;" f
position moonphase.py /^def position(now=None): $/;" f
Executable
BIN
View File
Binary file not shown.
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
#date +%d_%m_%y
find . -type f -daystart -mtime -1 | grep "$1"
Executable
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
A=$1
B=$2
C=$3
RESULT=`echo "$B*($C/$A)" | bc -l`
echo $RESULT
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
tor-browser --detach chatrubate.com
+80
View File
@@ -0,0 +1,80 @@
#!/bin/bash
# Nastav proměnné
input_dir="/run/media/kof/kof17/recordings/field/2024/101NIKON"
output_file="sběr2_kof_24.mp4"
interval=14.88 # každých 15 sekund
duration=0.12 # délka klipu
rm /tmp/*.mp4
# Dočasný soubor pro seznam klipů
temp_list=$(mktemp)
# Vymaž dočasný seznam, pokud existuje
> "$temp_list"
# Funkce pro porovnávání dvou čísel pomocí bc
compare_numbers() {
local num1="$1"
local num2="$2"
if [ "$(echo "$num1 < $num2" | bc)" -eq 1 ]; then
return 0
else
return 1
fi
}
# Funkce pro sčítání dvou čísel pomocí bc
add_numbers() {
local num1="$1"
local num2="$2"
echo "$num1 + $num2" | bc
}
# Projdi všechny soubory ve složce
for video in "$input_dir"/*.MP4; do
# Zjisti délku videa (v sekundách, s přesností na tři desetinná místa)
total_seconds=$(ffmpeg -i "$video" 2>&1 | grep "Duration" | awk '{split($2,a,":"); print a[1]*3600 + a[2]*60 + a[3]}' | bc)
# Kontrola, zda byl správně získán total_seconds
if [ -z "$total_seconds" ] || [ "$(echo "$total_seconds < 0" | bc)" -eq 1 ]; then
echo "Nelze získat délku videa pro $video. Přeskočeno."
continue
fi
# Každých $interval sekund vystřihni klip o délce $duration sekund
start="0"
while compare_numbers "$start" "$total_seconds"; do
output_clip=$(mktemp --suffix=.mp4)
# Přidání nuly před desetinné číslo, pokud je potřeba
start_formatted=$(printf "%.6f\n" "$start")
start_formatted=$(echo "$start_formatted" | awk '{print ($1 < 1 && $1 > 0) ? "0"$0 : $0}')
# Výstup z ffmpeg se nyní zapisuje do /dev/null pro odstranění výstupu
ffmpeg -y -ss "$start_formatted" -i "$video" -t "$duration" -c copy "$output_clip"
# Ověření, že klip byl správně vytvořen
if [ $? -eq 0 ]; then
echo "file '$output_clip'" >> "$temp_list"
else
echo "Při zpracování souboru $video došlo k chybě, přeskočeno."
rm "$output_clip"
fi
# Zvýšíme startovací čas o interval
start=$(add_numbers "$start" "$interval")
done
done
# Spoj všechny klipy do jednoho souboru, pokud je seznam klipů neprázdný
if [ -s "$temp_list" ]; then
ffmpeg -loglevel warning -f concat -safe 0 -i "$temp_list" -c copy "$output_file"
else
echo "Žádné klipy nebyly vytvořeny."
fi
# Smaž dočasné soubory
rm "$temp_list"
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
find . -type f -daystart -mtime -7 | grep "$1"
Executable
+44
View File
@@ -0,0 +1,44 @@
#!/bin/sh
#
# Take a pathname as an argument and output a playlist to standard
# output and errors to standard error.
#
# The output format is repeated sequences of:
#
# <pathname>\t<artist>\t<title>[\t<bpm>]\n
#
# If the tab (\t) or newline (\n) characters appear in a filename,
# unexpected things will happen.
PATHNAME="$1"
if [ -d "$PATHNAME" ]; then
find -L "$PATHNAME" -type f |
grep -iE '\.(ogg|oga|aac|cdaudio|mp3|flac|wav|aif|aiff|m4a|wma)$'
else
cat "$PATHNAME"
fi |
# Parse artist and title information from matching filenames
sed -n '
{
# /[<ABnum>[.]] <artist> - <title>.ext
s:/\([A-H]\?[A0-9]\?[0-9].\? \+\)\?\([^/]*\) \+- \+\([^/]*\)\.[A-Z0-9]*$:\0\t\2\t\3:pi
t
# /<artist> - <album>[/(Disc|Side) <name>]/[<ABnum>[.]] <title>.ext
s:/\([^/]*\) \+- \+\([^/]*\)\(/\(disc\|side\) [0-9A-Z][^/]*\)\?/\([A-H]\?[A0-9]\?[0-9].\? \+\)\?\([^/]*\)\.[A-Z0-9]*$:\0\t\1\t\6:pi
t
# /[<ABnum>[.]] <name>.ext
s:/\([A-H]\?[A0-9]\?[0-9].\? \+\)\?\([^/]*\)\.[A-Z0-9]*$:\0\t\t\2:pi
}' |
# Extract BPM metadata from title (eg. "Ghostbusters (115.6 BPM)")
sed '
{
# BPM
s:\(.*\) *(\([0-9]\+\.\?[0-9]\+\) *BPM)$:\1\t\2:
}'
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
find . -type f -daystart -mtime -2 | grep "$1"
Executable
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
playit ()
{
EFF=$1
LOC=$2
DIMMENSIONS='video/x-raw, pixel-aspect-ratio=1/1,width=1024,height=576'
#
# if (($SEL>=4))
# then
# DIMMENSIONS='video/x-raw, pixel-aspect-ratio=1/1,framerate=25/1,width=1024,height=576'
# fi
#
gst-launch-1.0 souphttpsrc location="$LOC" ! tee name=t ! decodebin ! videorate ! videoscale ! $DIMMENSIONS ! queue ! tee name=a\
a. ! decodebin ! gleffects effect=$EFF ! glimagesink\
t. ! decodebin ! autoaudiosink
}
##############################################
cd ~/irclogs
./sync.sh
for i in `./getVideos.sh|tail -n1`; do
ADDR=`youtube-dl -g "$i"`;
echo "playing pipe no: "$COUNTER;
playit $1 "$ADDR"
done
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
playit ()
{
EFF1=$1
EFF2=$2
LOC1=$3
LOC2=$4
DIMMENSIONS='video/x-raw,pixel-aspect-ratio=1/1,width=1024,height=576'
#
# if (($SEL>=4))
# then
# DIMMENSIONS='video/x-raw, pixel-aspect-ratio=1/1,framerate=25/1,width=1024,height=576'
# fi
#
gst-launch-1.0 uridecodebin uri="$LOC1" use-buffering=true ! tee name=t\
t. ! decodebin ! videorate ! videoscale ! $DIMMENSIONS ! gleffects effect=$EFF1 ! gleffects effect=$EFF2 ! glimagesink\
uridecodebin uri="$LOC2" use-buffering=true ! decodebin ! autoaudiosink
}
##############################################
#ADDR=`youtube-dl -g "ytsearch:$3"`;
ADDR=`youtube-dl -g "ytsearch:$3"`;
VIZ=`echo $ADDR | tr ' ' '\n' | head -n 1`;
SND=`echo $ADDR | tr ' ' '\n' | tail -n 1`;
playit $1 $2 "$VIZ" "$SND"