Ana içeriğe atla

Kayıtlar

Getting along with Django

These days I am tackling with Django on a centos server. I installed django package downloaded from its site.Started a simple app. Now trying to use database mysql. When it ocmes to mysql I needed to install some packages like mysql-devel,python-devel and most importantly MySQL-python (notice the capital letters). An older version of this is in centos stable repos.After some search I learned I can install it in different ways like compiling or using test repo.I chose the former and installed python-setuptools. And then I realised that there is easy_install in this package which helps me installing the required MySQL-python package. And voila.

Getting along with JQuery,Validation,Masked Input

JQuery is a nice library with whom I havent played till yesterday. Since yesterday I am struggling with this nice library, actually not solely with it but with validation plugin. That plugin is nice too but when it comes to integrating it with another plugin which you guess Masked Input, I was having problems. Because my form is dinamic and I am adding elements whose names are the as previous ones, I have struggled a lot. But at the end I did what I wanted to do. This jQuery.validator.addMethod("acceptreg", function(value, element, param) {   return value.match(new RegExp("^" + param + "$")); }); small code piece helped me a lot when validating text and phone fields and their integration with Masked Input. I know validation plugin normally does validate against phone but my case was different. I declared such a method as described above and used it inside with tel: { required: true, minlength:11, maxlength:11,acceptreg: "[0-9]{3}-[0-9]{7}" }, I d...

Centos mcelog reports incorrect record size

On a centos 5.5 64 bit server I was getting mcelog errors from cron.hourly/mcelog.cron stating "/etc/cron.hourly/mcelog.cron: mcelog: warning: record length longer than expected. Consider update" As a workaround I did add 2>&1 to the last line of /etc/cron.hourly/mcelog.cron file as mentioned in Known Issues in this page http://elrepo.org/tiki/kernel-ml    

An Encryption Method

Lately I have been told to make a new encryption method as an assignment. The method should be not preused and tried before. So it was me who is supposed to invent a new encryption method. I have thought of Rubik's cube and placing the letters of the alphabet on this cube. Then the coordinates of each letter would be send as ciphertext. Thinking on it lead to some diffucilties. So I decided to take another way. I believe that a good  encryption technique is still available by using Rubik's cube but for now I quitted. Instead, I thought of 3x3 or 5x5 squares on which we place the letters beginning from an arbitrary letter but obeying the order. So here is an example with a 3x3 square   2 H I J 1 K L M 0 N O P   0 1 2 With such a layout we represent each letter on this square using the pivot letter (lets say) L H=L02   I=L12   J=L 22   K=L01  L=L11  M=L21 etc.  On a 5x5 square we will have similar representations of letters. Even...

Windows Server Anomalities

Lately I have been struggling on port forwarding to a windows 2003 server from different modems. There were 4 modems pointing to same windows server port. I couldnt have succeeded in forwarding all these same ports from 4 modems to this server. Some were pointing some wasnt. I finally realised that this is a stupid mistake about windows routing configuration. I have had enabled the auto metric configuration for the gateways. But that was the wrong thing I did. There were different metrics for each gateway and this was causing the trouble. I changed them to same number and voila. All ports are forwarding coreectly.  

Centos Nginx PHP APC FastCGI 2 (Dealing with problems)

My journey to nginx continues with problems that follow up. I have had 3-4 problems to get nginx work. But after resolving them voila. It works now :) The problems were: directory index of "/usr/share/nginx/html/vhosts/domain.com/subdomains/data/" is forbidden -> Solved by writing the correct domain name to nginx.conf or any of virtual host files. No input file specified -> Solved by writing the full path of php scripts to one of my virtual host conf. FastCGI sent in stderr: "PHP Fatal error:  Uncaught exception 'Zend_Session_Exception' with message  'Zend_Session::start() - /usr/share/nginx/html/vhosts/lib/Zend/Session.php(Line:438): Error #2 session_start() -> which is solved by giving correct ownership to folders /var/lib/php and /var/lib/php/session. Before those folders owned by root.apache and I changed them to root.php where php is the correct user. Now lets benchmark the sites!