telnet cisco login
sh_int.sh:
#!/usr/local/bin/expect -f
spawn telnet [lindex $argv 0]
expect ogin {send login\r}
sleep 1
expect assword {send password\r}
sleep 1
send “terminal length 0\r”
#if juniper
#send “set cli screen-length 0\r”
send “show interface [lindex $argv 1]\r”
send “exit\r”
expect eof
./sh_int.sh cisco_1 gi1/1.5
ban sshd invalid user
tail -10000 /var/log/messages | egrep sshd | egrep Invalid | awk ‘{print $10}’ | sort -n | uniq -c | sort -n | awk ‘{print “iptables -I INPUT 1 -s “$2” -j DROP”}’ | sh
mysql check
#!/bin/sh
/usr/local/etc/rc.d/mysql-server stop;
/usr/local/bin/myisamchk -r —sort-index -O sort_buffer_size=16M /var/db/mysql/*/*.MYI;
/usr/local/etc/rc.d/mysql-server start;
mcrypt
#!/bin/sh
cd /home/user/passs
mcrypt -d ./passw.nc
cat ./passw
rm ./passw >/dev/null 2>&1
nat forward
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -I FORWARD 1 -s 10.0.0.0/8 -j ACCEPT
iptables -I FORWARD 2 -d 10.0.0.0/8 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -j MASQUERADE
passgen
cat /dev/urandom|tr -dc “a-zA-Z0-9-_\$\?\!”|fold -w 8|head
flash streaming
ffserver.conf:
Port 8090
BindAddress 0.0.0.0
MaxClients 100
MaxBandwidth 10000
CustomLog /var/log/ffserver
NoDaemon
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 100M
ACL allow 127.0.0.1
</Feed>
<Stream test.swf>
Feed feed1.ffm
Format swf
VideoCodec flv
VideoFrameRate 15
#VideoBufferSize 2048
VideoBitRate 128
VideoGopSize 30
#VideoIntraOnly
VideoQMin 5
VideoQMax 30
#VideoSize 640x480
VideoSize 320x240
Noaudio
</Stream>
<Stream stat.html>
Format status
</Stream>
ffmpeg:
local usb webcam -
ffmpeg -r 15 -s 320x240 -f video4linux -i /dev/video0 http://localhost:8090/feed1.ffm
axis 211a -
ffmpeg -f rtsp -i rtsp://webcam_ip:554/mpeg4/media.amp http://localhost:8090/feed1.ffm
webcam.html:
<html>
<body>
<p align=center>
<EMBED src=”http://local_ip:8090/test.swf” width=320 height=240 type=”application/x-shockwave-flash”></EMBED>
</p>
</body>
</html>
id3iconv
find -iname “*.mp3” | awk ‘{print “java -jar /home/user/bin/id3iconv-0.2.1.jar -removev1 -e cp1251 \42”$NE”\42”}’ | sh