Monday, September 26, 2011

Web develop tools....

Some useful links for help designing and developping....

1) Create image of loading state....: http://www.ajaxload.info/

2) Create simple and clean forms, js and css inclusive...: http://www.phpform.org/

3) Search free icons(very good!!): http://findicons.com/

4) Test, and produce over 68 differents screenshot for each browser for your site: http://browsershots.org/

Bye...

Monday, September 19, 2011

Mootools FormCheck: Ajax configuration

Currently I need to use a, ready to use, form to login....
I decide to use form-check of mootools available at:
http://mootools.floor.ch/docs/formcheck/files/formcheck-js.html

This is my configuration to allow ajax authentication(script tag in the head...)
No other configuration. The rest is the pure standard form-check:

<script type="text/javascript">
        window.addEvent('domready', function(){loginFormCheck = new FormCheck('formular', {
            submit : false,
            submitByAjax: true,
            submitAction: './loginManager',                //Action page used to submit the form data to.
            submitMethod: 'post',                //Method used to submit the form, valid options : 'post' or 'get'
            onAjaxRequest : onAjaxRequest,                //Function to fire when the Request event starts
            //onAjaxComplete : onAjaxComplete,            //Function to fire when the Request is complete, before and regardless of Success or Failure
            onAjaxSuccess : onAjaxSuccess,   
            display : {
                errorsLocation : 1,
                indicateErrors : 2,
                flashTips : true,
                fadeDuration : 1500,
                scrollToFirst : false
            },
            alerts : {
                required : 'This field is ablolutely required! Please enter a value'
            }
        })});
       
        function onAjaxRequest () {
            document.getElementById("loadingDiv").style.display = "block";
        }
       
        function onAjaxSuccess () {
            document.getElementById("loadingDiv").style.display = "none";
            window.location = "./home.jsp";
        }
       
       
    </script>

loadingDiv is a div where I have a simply "loading" animated gif.
loginManager is my servlet the manage the login logic.
Bye

Monday, September 12, 2011

Thumbnails creations overview: Imagemagick for pictures form videos

First of all, I need to create thumbnails of various types of document.
Pdf, video, doc, xls...... ecc.....
Pdf:
Ensure to have imagemagick already installed....
In case of not, you give:
 
apt-get install imagemagick

For thumbnail of pdf document you give:
convert -thumbnail 200x200 document.pdf document_preview.png
where 200x200 is the height for width you want to give to the  document_preview.png
In case of more than one pages for pdf document, you can give directly the page you want to obtain the preview image:
convert -thumbnail 200x200 document.pdf[0] document_preview.png

Video(avi):
Install ffmpeg
apt-get install ffmpeg
install ffmpeg.
So give the follow command:
ffmpeg -itsoffset -4 -i xxx.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 95x155 yyy.jpg

Friday, September 9, 2011

AIRCRACK easy source compilation and installation under Debian Squeeze 6.0.2

With the following commands I correctly install aircrack..... on my debian 6.0.2..
The binary installation fault for me..... I forgot the exactly error....
So.....
apt-get install build-essential devscripts dpkg-dev debhelper
wget http://ftp.debian.org/debian/pool/main/a/aircrack-ng/aircrack-ng_1.0~rc1-2.dsc
wget http://ftp.debian.org/debian/pool/main/a/aircrack-ng/aircrack-ng_1.0~rc1-2.diff.gz
wget http://ftp.debian.org/debian/pool/main/a/aircrack-ng/aircrack-ng_1.0~rc1.orig.tar.gz 
for building dependencias we have to download the following packets for packets version dependencies 
wget http://ftp.de.debian.org/debian/pool/main/s/sqlite3/libsqlite3-dev_3.7.3-1_i386.deb
dpkg -i libsqlite3-dev_3.7.3-1_i386.deb
wget http://ftp.de.debian.org/debian/pool/main/libn/libnl/libnl-dev_1.1-6_i386.deb
dpkg -i libnl-dev_1.1-6_i386.deb
wget http://ftp.de.debian.org/debian/pool/main/libp/libpcap/libpcap0.8-dev_1.1.1-2_i386.deb
dpkg -i libpcap0.8-dev_1.1.1-2_i386.deb
dpkg-source -x  aircrack-ng_1.0~rc1-2.dsc
cd aircrack-ng-1.0~rc1 
dpkg-buildpackage 
cd .. 
dpkg -i aircrack-ng_1.0~rc1-2_i386.deb
(In my case before the last dpkg -i commanmd I need to remove iw package..(with apt-get remove iw)) 


Bye and good luck......

Thursday, September 1, 2011

MySQL: install as deamon, for start/stop at system startup/shutdown (under CentOS 5.6 64 bit)

Go under mysql execution commands directory....:
cd /usr/bin/
Create startupMysql.sh file with the follow code:
#!/bin/bash
/etc/init.d/mysqld start
Create shutdownMysql.sh file with the follow code:
#!/bin/bash
/etc/init.d/mysqld stop
Give to them the execution privileges only for root
chmod 700 startupMysql.sh
chmod 700 shutdownMysql.sh
Choose the your "favourite" rcXXX.d directory (depends to your configuration)
to put into your deamon startup/shutdown commands.
I choose rc5.d, so:
cd /etc/rc5.d
and give the following ln -s commands:
ln -s /usr/bin/startup_mysqld.sh S100startupMysql
ln -s /usr/bin/shutdown_mysqld.sh K100shutdownMysql
Your deamon startup/shutdown commands are done well...
Now clean up the mysql log file(you find it into /etc/my.cnf), usually /var/log/mysqld.log
cd /var/log
echo "" > mysqld.log
to check, if at the system restart, you mysql restart too.
Restart the system.....:
shutdown -r now

Byw


MySQL installation and configuration under CentOS 5.6 64-bit

We have to search the name ho the packet to install....
yum search mysql
For my distribution the packet name mysql-server.x86_64
so do:
yum install mysql-server.x86_64
At installation completed, mysql is without password, and is down.
So startup the mysql
service mysqld start
so give the following command to reset password
UPDATE mysql.user SET Password=PASSWORD('NewPassword') WHERE user='root';
and
flush privileges;
to runtime flush up the executed command.
Give exit to logout to the mysql connection and test new root account logging in with the new credentials:
mysql -uroot -p

Bye