My own topics
This will disable SSH login as root
sed -i '/^PermitRootLogin/s/yes/no/' /etc/ssh/sshd_config && \
/etc/init.d/sshd restart
Server load is open source widgets for android that retrieve your current server average load and display it on a widget on your android home screen, you can add more widgets for each server. The widget will update every 30 min to display your server’s current average load. Check the php example for extracting your servers’ current load.
Program test on Galaxy s2
tested on Firefox 7.0.1
const Ci = Components.interfaces;
const Cc = Components.classes;
function ReadWrite( data ){
try{
Components.utils.import("resource://gre/modules/NetUtil.jsm");
Components.utils.import("resource://gre/modules/FileUtils.jsm");
var file = FileUtils.getFile("ProfD", ["FileName.txt"]);
var ostream = FileUtils.openSafeFileOutputStream(file );
var converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
createInstance(Ci.nsIScriptableUnicodeConverter);
if( data ){
if ( !file.exists() ){
file.create( Ci.nsIFile.NORMAL_FILE_TYPE, 420);
}
converter.charset = "UTF-8";
var istream = converter.convertToInputStream(data);
NetUtil.asyncCopy(istream , ostream, function(status) {
if (!Components.isSuccessCode(status)) {
alert( "Error! :" + status );
return false;
}
});
}else{
var data = '';
var fstream = Cc["@mozilla.org/network/file-input-stream;1"].
createInstance(Ci.nsIFileInputStream);
var cstream = Cc["@mozilla.org/intl/converter-input-stream;1"].
createInstance(Ci.nsIConverterInputStream);
fstream.init(file, -1, 0, 0);
cstream.init(fstream, "UTF-8", 0, 0); // you can use another encoding here if you wish
let (str = {}) {
let read = 0;
do {
read = cstream.readString(0xffffffff, str); // read as much as we can and put it in str.value
data += str.value;
} while (read != 0);
}
cstream.close(); // this closes fstream
return data;
}
}catch(e){
// alert( e);
return false;
}
}
Show your support for the Egyptian revolution by adding this code to your website and blog
<img border="0" id="corner-ad" src="http://gadelkareem.com/tmp/jan25.jpg" width="222" height="111" /> <style>#corner-ad {
display: block;
width: 222px;
height: 111px;
position: fixed;
top: -16px;
right: -70px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
}
#corner-ad {
top: -80px\9;
right: -70px\9;
*right: -70px;
filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476);
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)";
zoom: 1;
}
</style>
A Demo of this code can be seen on the top right of this page
This the simplest tooltip jQuery plugin you can find around.
-
features:
- takes advantage of live(), mouseenter and mouseleave methods
- tracks mouse movement
- right and bottom viewport border tracking
- can be applied on any element
Demo – download – Google code – GitHub