Archive | August, 2010

Use IPTables to ban repeated ssh attempts

My logs were getting filled with scripts trying to log in via ssh. I already have “PasswordAuthentication no” so I believe I am safe. I wanted to add a new layer (and keep my logs cleaner). I added the following to my iptables config. Anyone with more than 4 connections in 60 seconds is banned:

:SSHAUTOBAN - [0:0]
. . . 
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j SSHAUTOBAN
. . . 
-A SSHAUTOBAN -m recent --set --name SSH
-A SSHAUTOBAN -m recent --rcheck --hitcount 4 --name SSH -j LOG
-A SSHAUTOBAN -m recent --update --seconds 60 --hitcount 4 --rttl --name SSH -j DROP
-A SSHAUTOBAN -m recent --rcheck --name SSH -j ACCEPT
COMMIT

My CEWP JQuery code to play flash files in a Modal

I have Flash files in a Document Library. I wanted to have users click the flash files (swf) and have them open up in a hidden div, rather than opening in a different window. I added the code below to a CEWP:

<script type="text/javascript" src="http://jquery.thewikies.com/swfobject/jquery.swfobject.1-1-1.min.js"></script>
<script>
$(document).ready(function() {
//
$("#popupclose").click(function () {
	$("#popup").Hide();
	$('.media').flash().remove();
	return false;
});
//
$("a[href*='\.swf']").each(function(){
	this.onclick = function(){
	var filetoopen = $(this).attr("href");
	$("#popup").Show;
	$('.media').flash({swf:filetoopen,height:600,width:1000});
	return false;
	};
}); 
//
});
</script>
<style type="text/css">
#popup{  
 display:none;    
 position:absolute;  
 top: 10px; 
 left: 10px;
 background:#FFFFFF;  
 border:2px solid #cecece;  
 z-index:2;  
 font-size:12px;
 }   
</style>
<div id="popup">  
  <a id="popupclose" href="javascript:void()">close</a>
<br/>
  <div class="media" style="vertical-align:top;"></div>
</div>

Powered by WordPress. Designed by WooThemes