watchdog is a python package uses to notify linux kernel subsystem to watch for any changes to the filesystem. This is very handy package Lets create a watcher using watchdog and save information to DB when any event occur. 1. Firstly I will write watcher class which look like import time import psycopg2 from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler class Watcher: DIRECTORY_TO_WATCH =...
Read MoreCreate date-range selector with angularjs directives
Directives are most important components in angularjs application. Although Angularjs ships wide range of directives. But sometimes you will need to create your custom directives. So, Lets started a very important directive ‘Date-Range-Selector’ directives. we will use bootstrap daterangepicker, momentjs So, lets start custom directives angular.module(‘app’). .directive(‘dateRange’, function() { return {...
Read MoreSoap server authentication using nusoap
Problem scenario: You want to create a secure soap server with nusoap library. In the nusoap library there is no better way to make authentication Efficient solved scenario: There is 2 way to make authentication 1. You may create a custom function which works for authentication and you need to pass username and password in every call 2. You may send authentication data in soap header. All time you process the username and password data...
Read MoreCreate a socket server in php and run as a service
Problem scenario: Suppose you have a ecommerce site where customer can put an order. Then site will be notify you via sms or any device when new order found Efficient Solved scenario: You have to build a socket sever which check the new order and response you, then you will collect the new order from your e-commerce site Prerequisites PHP Sockets library. The extension is enabled at compile time using the –enable-sockets configure...
Read Morewidget create in a miniute
in wordpress you can create your widget in a simple manner, the process is so simple given below the widget plugins name is “widget-test”. you can modified that as your need /* Plugin Name: widget-test */ ##never forget this function configuration ##never forget add $before_widget,$before_title, $after_title and $after_widget ## example given below function widget_test($args) { extract($args); echo...
Read MoreClass for Backup_Restore of Mysql database
Today i’m very happy, cause myclass has been approved in phpClasses. i submit my class in phpClasses last 15 days ago. approved information get yesterday. you can backup and restore your mysql database very simply way using my class. it produce a .sql file as a backup file, and also you can restore this file using my class. Backup: when you call my backup_database method, it create a yourdatabase_name.sql file under the...
Read MoreConfigure CakePHP in Ubuntu
Configure CakePHP on Linux/Ubuntu is a bit tricky as you have to on the mod-rewrite and set the AllowOverride property from None to All. 1. mod_rewrite is a part of Apache server that can rewrite requested urls on the fly. To enable mod_rewrite in Ubuntu, you just need to write this command in terminal: [sourcecode language=’php’] sudo a2enmod rewrite [/sourcecode] 2.Open and edit the default file from this directory...
Read More