Hi,
Yesterday I was trying to improve some code, so it was time to integrate memcached to have a increment in velocity of the app. Like the server is PCI compliant, everything needs to be installed from source.
Memcached depends from libevent, so first you configure,compile and install that library first.
After that, download the memcached package from source and compile. Now, memcached runs as a daemon, like apache, bind etc… So, from the compiled source directory, copy the scripts folder to the /usr/share/defaults directory, and here you will find the init.d script for Debian and derivated version and config file that should be on /etc . If your binary or installation paths are different, you will need to edit the init.d script and start-memcached script also that inside scripts folder. Test it locally and after you are sure everything works, you can use this command to start memcached and boot:
update-rc.d memcached defaults
With this you have the memcached daemon installed, you can tune up the memory available and other parameters on /etc/memcached.conf. Now is the time to install the php extension from PECL, unpack it inside your php ext source directory with the name “memcached”, there, run a phpize, configure, make and make install as any extension.
Regards.
Related Post
Hi,
when you have several virtualhosts with SSL enabled and also, the certificate has been generated with a pass phrase, you need to use SSLPassPhraseDialog to print to apache the password each time it starts, the problem comes as this directive can only be declared 1 time in the general configuration, so to use several password for each SSL generated, you can use this code:
#!/bin/sh
PASS1=”password1″
PASS2=”password2″case $1 in
www.url1.com:443) echo $PASS1;;
www.url2.com:443) echo $PASS2;;
esacexit 0
just replace the passwords and url with the one configured on your webserver, set them execution permission and add this to your apache conf:
SSLPassPhraseDialog exec:/path/to/bash/file
Regards,
Shadow.
Related Post
Hi,
i’m migratin a server, and i’m installing everything from source, so, the old server have subversion too, and after installing apache, mysql and php, i need it and configure it to use DAV for user authentication. for my surprise the apache source comes with the dav module do not include the mod_dav_svn and mod_authz_svn, and i found almost no info of how to make it work.
so to everyone who need it, just add the –with-apr flag when you configure the subversion source, like this:
./configure –with-apr=/usr/local/apache2/bin/apr-1-config
of course, your compiled version of apache needs to have apr, adding the flag “–with-included-apr” will do the trick
then use make and make install, automatically will place the modules on the apache module directory and you will be able to load it from there.
when you restart apache loading this modules, found any missing library or shared object error, check that the file is on /usr/local/lib and /usr/lib depending your apache configuration. it should be in at least 1 of those locations, to fix it, i just created a symbolic link of the file in the missing location and that fixed the problem.
i hope this will be useful for you
Regards,
Shadow.
Related Post
Hi,
i wonder if someone still visit this blog xD
sorry for leave you behind, i usually use this space to share things or code that i discover that solve some common problems, but recently, i didn’t discovered anything
i have been very busy working on hvc.com most of time, i’m playing the piano too on a little of spare time i have and trying to build some ideas i also i want to move forward.
nothing else more than that really, i hope i could have some other news the next time i write here, if you want specific updates about my projects, check our facebook page at Ipsilon Developments
see you
Regards,
Shadow.
Random Posts
Hi,
recently i moved some scripts to a new server, so i was needed to reinstall everything from the old one. this has been also a change of platform, as the old was on a debian lenny, and this new one was a RHEL 6.0. in resume, here are the instructions of how to install imagick and support it on your php installation for any redhat based distribution:
yum install ImageMagick.i386
yum install ImageMagick-devel.i386
pecl install imagick
echo “extension=imagick.so” > /etc/php.d/imagick.ini
service httpd restart
of course, change i386 with your architecture (like x86_64) and also, you need to install php-pear package to be able to use pecl and install the php extension.
i hope you find this useful
Regards,
Shadow.
Related Post
Hi,
has been a while since my last post right? was not my intention, but a lot of things are going on recently, job and personal related stuff that consume me a lot of time, that didn’t left too much for this blog.
i just wanted to share some stuff i have been doing this last weeks:
1)worked 90% of my time on www.hvc.com improving stuff and making new features that will be launched soon, and you will be surprised with what i pulled from the hat this time
2) i improved the code of 7lay.net a little, still need to work on it a LOT, i need to figure out a way to improve the user experience and offer something different than the other portals with the resources i have
3) update the ipsilon developments site with links to our latest projects and stuff made. i think it looks nice, simple and showing what i made this past time, that is what really matters.
also we have now too the facebook page and the twitter profile if you want to follow and get the news of our latest developments
4)launched File2PDF.com a service to convert pdf files online, i’m planning to do a android client, but i dunno when i would finish with it
5)following a local trend for a youtube video, i launched TuPasman.com, a site that let you put on the protagonist screen any youtube video and share it.
and that’s it folks, i will have more news soon and probably some more useful post with more tech info will arrive too
Regards,
Shadow.
Random Posts
Hi,
recently i was needed to add some like and tweet button to a site. i supposed will be a 5 minuted task, but i discovered something really weird, that for some reason, the button not only was screwing up the load of the adsense ads, but also, sometimes the ads appeared inside the iframe of the buttons. looking for a solution on the web, i found something for the facebook like button and i applied something seamless for the twitter button.
Facebook Like Button
the steps to solve this are the following:
1)go to this page and create an application: https://developers.facebook.com/setup/
2) paste this code where you want the like button and edit with the correct paths and the appID you generated before
<!-- like button -->
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like layout="button_count" width="100"></fb:like>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'XXXXXXXXXXXX', // ID generated for WEBSITE provided above.
xfbml : true, // parse XFBML
channelUrl : 'http://www.YOUR_SITE_NAME.com/facebook/channel.html' // new file custom channel
});
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
<!-- like button -->
3)create the channel.html file on the path of your server and paste this only line:
<script src="http://connect.facebook.net/en_US/all.js"></script>
and that’s it, now you have a like button and will not screw up your adsense ads
Tweet Button
for the tweet button, the solution is more simple, i basically pasted the code inside a file and called it from a iframe. is not the most cleanest way, i know, but is the only thing i figured out to solve it.
i hope this help you in some way
Regards,
Shadow.
Related Post
Hi,
maybe this could sound obvious but is something that i didn’t know till a few days ago when i was making some changes on a js code i made. like the title says, the each() function used in mootools to apply a code to each element in the array, do not work with associative arrays.
so basically if you have this code:
var myArray=new Array();
myArray["key1"]="value1";
myArray["key2"]="value2";
myArray.each(function (item, index){
//do stuff
});
will not work, simply will not execute the loop on each array element. to fix this, you need to use the for loop like this:
var myArray=new Array();
myArray["key1"]="value1";
myArray["key2"]="value2";
for(key in myArray){
//do stuff
}
dunno if this is a mootools bug or was designed to work like this, but i hope this help you and save you time in debugging when you are using associative arrays.
update: from the comments below, let’s clarify some things:
*there is no associative arrays in javascript, they are objects, and i was wrong, indeed you can process it using the solution that Dimitar Christoff posted
var myArray= {};
myArray["key1"]="value1";
myArray["key2"]="value2";
Object.each(myArray, function (item, key){
console.log(item, key);
});
*when you process the object like this, you need to check that you are not processing the js methods that mootools define, personally i stop processing the object after i found the “$family” key, in the comments recommend to use the hasOwnProperty() function but i don’t see why is better or different than mine, if you know it, post it
thanks for the comments, i recognize when i’m wrong, for your collaboration, i’m a bit a better dev
Regards,
Shadow.
Related Post
Hi,
months ago i wrote this post where i commented about a tool that adobe was developing that convert any fla into html5. on the same post i also talk about the eternal fight of flash vs html5 and the “end of flash”, i recommend you to give it a quick read. today adobe have released this tool to the public, you can download it from here
of course that the app is on a test phase, is not even a beta version, but i hope flash will continue the development converting it into a real product.
Regards,
Shadow.
Related Post
Hi,
i just saw this on my twitter TL and i think it worth a mini-post. All those who develop some application that require user authentication, deal with the password problem. is not only a problem to store passwords (BTW, i wrote another post about it recently) but also the problem is the user, trying to encourage him to use stronger ones, using uppercase, lowercase letters, number and symbols is not easy. usually most of the app’s have a bar that measure the strength of the password. is nice and useful, but most of the users just don’t pay attention to it. in this cases is where naked password take action and i will not say anything else, just go to the site and try it, is a twist in usability to say it in some way
Regards,
Shadow.





