This morning i found out my server is down because the space was exceeded.. so i went to clear up some cache/backup files to free up some space.
At first, my tries to ssh the server failed, i guess the server was REALLY crowded that i didn’t hear my call, anyway, using the Plesk ‘Repair mode’ option, i successfully removed one large backup file, and restarted the server..
Anyway, what i’m writing about is that RM seem to have some limitation if you told it to remove a big list of files:
I used: rm *.cache
and it gave the following message: -bash: //bin/rm: Argument list too long
After stumbling alittle, i found this article :
http://www.moundalexis.com/archives/000035.php
and it solves that problem uses: find . -name '*.cache' | xargs rm
After spending 3 painful hours fixing options of cForms plugin for WP, after migration to live site, i’ve discovered this bit of code at php.net, which helped me fix the options array and get my forms back online.
Note: Change Parameters field to put the correct path to your machine’s VMX file, and perhaps you would need to change the Executable fields as well if you’ve a custom path for your VMWare Workstation installation.
I’ve been searching – for a good amount of time – for a way to send unicode message using Clickatell API’s .. i didn’t find any solution, though i found a lot people searching just like me for the same solution.
After a lot of searches, trails and testing .. I’ve found a solution posted by [ tried to find the source but couldn't remember ] that does some unicode conversion functions, from which i could find what i want.
I extracted the peace of code i needed, minified it, and here it is:
You can download the file here unicode_cp.js [ Size : 430 Byte ]
Instructions :
1- Include the script into your page containing the form
2- Create a textarea as the message text , it’s better that it doesn’t have a ‘name’ attribute, so it won’t be submitted, it’s contents will be converted to code points and saved in a hidden input which will be actually submitted with the form.
3- Hook the encoding function to keypress event of the textarea#txt
window.onload= function() {
txtBefore= document.getElementById("txt");
txtEncoded= document.getElementById("encoded");
txtBefore.onkeypress= function(e){
// Allow only backspace [ delete ] button when character count is over 70
if (this.value.length>=70) {
if(e.charCode!=0){
return false;
}
}
};
txtBefore.onkeyup= function(e) {
txtEncoded.value= str2cp(txtBefore.value);
};
};
You can also create a checkbox to enable\disable conversion, in case the user wants to send the message in plain English, hence increasing the message limit, to do that add the following as the first line of onkeypress function :
if(uni_check.checked) return false;
and the following as the first line of onkeyup function :
I’ve always longed to have a subdomain like myhomeserver.gr80.net to point at my home server ( obviously! ) .. but there is always fees for such services, like No-IP and DynDNS Pro ..
I figured out an easy way to have your own sub domain, pointing at your home server ( assuming you have a dynamic IP connection, or you wouldn’t need this tutorial ) ..
Requirements :
1- Free DynDNS Account
2- Domain Name, ( Domain Control Panel must allow you to create sub domains as CNAME entries, which is available on NetFirms )
Steps:
A) Configure your dummy free sub domain:
1- Create a Free account on DynDNS.org
2- After logging in, Choose “Add Host Services” , Add your desired sub domain ( which doesn’t really matter, it’ll be overridden eventually ) , activate the sub domain ..
Follow the screenshots here :
B) Configure your Domain on Netfirms ( or whatever your registrar is )
1- After Logging to your panel, Choose “Add”
2- Add the desired sub domain ex: myhomeserver.mydomain.com
3- Choose CNAME type, and add your DynDNS Free sub domain .
Follow the screenshots here :
C) Configure your router \ software to use the created DynDNS
1- You can find a tab in your router setup called ( Dynamic DNS \ DDNS \ DynDNS ) .. where you should enter your account credentials on DynDNS.org ( the account you just created ).
Or if you do not have a DDNS-enabled router, you can always go with software like DirectUpdate , it’s the best one i’ve tried, always fulfilling my needs..
Voila! you now have a fully working FREE Dynamic DNS service on your own domain! Enjoy!
I’ve been around searching for a good tool to check share-sites files if they’re still alive or dead..
During my check, I’ve stumbled upon RS’s own link checker at http://rapidshare.com/checkfiles.html .. found that they’re using a simple API provided from RS ..
I’ve used their API before for uploading stuff from my linux machine, the whole API provided by RS was a tiny Perl script used to upload files and keep the logs saved.. it just did the job then..
But now, they’ve expanded their API to good extents .. Now you can do a lot of things using simple API calls to their website.
Anyway, back to my main target, which is a link checker for Rapidshare files..
I’ve created this small function to help me check files the easy way, for i’ll be integrating it in WordPress at a friends website soon ..
Sewing a lot of intranet applications at the NGO, i found it a must to work around electricity blackouts .. and there is a plenty down there ..
So, i managed to get the server starting-up when electricity is back .. using a BIOS setting that lies there in almost all the modern Motherboards nowadays..
But came to the bigger problem, running the machine on windows start ..
This could be easy if you’re the only user of your machine, with no password, having the automatic log-on in effect .. but if you are on a server where you have to enter a password to log-on , this would be kinda clingy ..
Googling alittle, i found a utility which can be used to run windows application as services , and set to start on windows boot rather user log-on .. It’s called FireDaemon [ Download it HERE, or Google it ] ..
I started installing Firedaemon .. opened the GUI afterwords, it looks like this :
Then i began creating a new service, specifying VMWare main executable ( vmware.exe ) as the server application, and ( -x “Drive:\Path\to\VM\machine.vmx” ) as the parameter, as you can see in the picture :
Voila! Close FireDaemon, and restart your computer to make sure everything is OK.
UPDATE on 18/02/2010 : Use the internal built-in tool vmrun.exe to achieve better results, and to remove the nagging screen of Interactive Services message. Check out the updated post.
Long I’ve searched for a method to center elements vertically using CSS or even deprecated HTML codes.. but never found a proper way to do it ..
Now i figured an incredibly easy way to do it using Javascript, with my beloved jQuery..
You only have to assign one CSS value to the box you want to center:
.centeredBox{ position: absolute }
After including jQuery from Google Code ( or from your own local folder if you like ) :
Use the following function to center the elements:
function setPosition(){
var tasks=$('#tasks');
var h=$(document).height(), th= tasks.height();
tasks.css("top", (h-th>0?((h/2)-(th/2))+'px':0) );
var w=$(document).width(), tw= tasks.width();
tasks.css("left", (w-tw>0?((w/2)-(tw/2))+'px':0) );
};
As a final step, you would need to add the following lines in your js file , so it applies the center hack each time you resize your window :
then applying some styling to make it a horizontal menu that go at the top of the page :
after integrating latest version of jQuery hosted at Google Code using the following code :
i added the following markup to create the targeted effect: UPDATE: Now using stop() to prevent repetitive animation, Thanks Allan for your notice.
first line is to make sure child div’s are positioned just under their main link , then second line makes the hover effect by invoking the animate function to control both opacity and left property of the child div.