Spacer
Spacer

NGCODERS.COM

[ NEXT GENERATION CODERS ]

Spacer

Archive for the 'Downloads' Category

Connection Keep Alive

Here is a small utility i wrote which helps me remain connected, gives vocal notification when i disconnect and is capable of resetting my router in case the router needs restart.

Some reasons i wrote it

  • Bad MTNL ADSL Connection , disconnects every few minutes.
  • Using Ping was not really helping, ping worked but when http request was sent Internet disconnected.
  • Could not find any utility giving Vocal Notifications.
  • Could not find any utility capable of executing applications in case of disconnection/connection. I needed my router to be reset when i disconnect due to some XBOX Live issues.

Anyhow it was written in a weekend , and am using it now and some of you guys might also find it useful so am releasing it for free. This requires .net 2.0 + .

Some features -

  • Configurable fetch sites and fetch timeouts.Uses HTTP fetch.
  • Vocal Notification of connection and disconnection.
  • Execute application when connection or disconnection takes place. Usefull when you need to reset router etc.
  • Sits idle in status bar , with notification icon and Baloon Tips.

In-case of ideas or bugs post them here .

Free Eye Rest and Break Reminder

Rest Reminder is a small utility which i wrote long time back to monitor computer activity and reminds me to take rest after every 30 minutes. I wrote this because once i start working i forget about everything else and this lead to dry eyes, irritation etc.This is the second version supporting Multiple monitors, Alpha Transparent block screen and Vista Compatible.

Unlike most such utilities this is free. You can specify after how much time of activity you want to take rest and for how long. And how long of inactivity will reset this time. This also comes facility to lock screen quickly or when there is a certain inactivity period.

Usage is very simple , Download and extract the program and then run the RestReminder.exe . After that configure the settings and press Apply to save changes. Press the close/hide button and let it go in the task bar.

JTemplate - Joomla tempaltes on Drupal

Jtemplate is the first step towards Joodr,It aims at allowing usage of vast number of premium joomla templates with drupal with minimal effort. It is basically a set of Drupal Module and a templating Engine based on phptemplate. The idea is to allow the use of Joomla templates on Drupal as good templates for drupal are missing, drupal templating is expensive and few premium template providers who are there charge really high.Currently you just need to upload the template to the themes directory and just create a dummy template_name.infofile in the directory and the rest everything is taken care by Jtemplate.

Currently a lot of work is still remaining but here are a few features -

  • Drupal 6 supported
  • Joomla 1.5 templates compatible
  • Little to no changes required to Joomla templates
  • Support for Template params and Template styes from admin
  • Effects and Suckerfish menus supported
  • Tested with premium templates from some providers.

Anyhow will be releasing the download soon , am looking for people to help me improve it for now.As everything does not work :) .

You can check a demo here - http://joodr.org/demo/ . The demo is running plain Drupal 6.5 with Jtemplate installed. The template is from rocketheme , with no changes or editing done :) .

Here is an alpha release as im not getting time to work on it , this is meant for people comfortable with drupal and know what they are doing.

Upload the site structure in the zip file and enable jtemplate module in the admin. To create menus use joomla like names mainmenu,footer,usermenu etc for drupal menu name. Also make the default drupal theme as admin theme from settings.

PHP automatic file and database backup script

This is a pure php implementation of a php backup script. So it should work fine on windows and linux. But its not suited for takeing very large backups.

I just wrote it cause most of the script i saw offered file or database backup and broke down to usage of exec  and unix commands , for which i had to contact hosting.

Some basic features -

  • File and Directory backup
  • Multiple database/table sql backup
  • Backup email


The script is supposed to be called using automatically using CRON , and the backup folder in which backup it taken should be writable.All you have to do is run backup.php .

Edit config.php before use. Released under GNU GPL license.

PHP Youtube video downloader script

I was searching for a simple script which would allow me to download videos from youtube using php. I did find some implementation but only one of them worked and it used Pear. So here is a simple script to help you download videos from youtube. Allows you to download restricted videos too by logging into youtube.

The script is a simple youtube class which uses CURL.

Sample usage of the youtube class -

include(’curl.php’);
include(’youtube.php’);

$tube = new youtube();

// Only required for restricted videos
// $tube->username = “userid”;
// $tube->password = “password”;

$download_link = $tube->get($_POST['url']);

PQuery - PHP and JQuery

PQuery is a set of helper classes for JQuery JavaScript library.This library allows you to easily integrate AJAX , Effects and other JQuery functionality into your PHP scripts.IT has a small foot print and is compatible with PHP4 and PHP5.

PQuery Demos : PQuery Demos.

Documentation : PQuery Documentation .

License : MIT or GPL ( what ever you wish to use )

Internet Speed Simulator / Proxy throttler

Speed Simulator

Speed simulator is a simple throttling proxy which allows you to see how your site behaves under diffrent connection speeds. It was written by me to test AJAX/Flash loaders and see how much my time took to load.You can simulate various speeds like that of a modem or a ADSL.A pre delay function is also there to help simulate delays due to DNS , connection establishment etc.

See the Demo Video to see how it works.

Installation

Simply unzip from the archive and double click on it to run it.

Usage

Just select the Speed and the Port on which you want Speed Simulator to start on. Once this is done open your favorite browser and set the proxy to 127.0.0.1 and set the port to the select port (default 8080).Now click start in Speed Simulator and open the site that you wish to test.

Selling Digital Goods/Ebooks With Paypal IPN and PHP

Recently I wanted to sell a small script for which I was getting some requests.I wanted the procedure to be as efficient as possible where the user was delivered the script though a secret link once the payment was made. After some thorough searching around the net , I found that though the Idea and procedure is so simple there exist No Free scripts
to do so ( Weired ). So in this tutorial we build a small script which can be used anywhere to sell digital goods online using Paypal IPN.They can be ebooks, shareware , software, images anything Bits and Bytes.

The script has the following features

  • Complete automation of your online orders.
  • Automatically emails your customers and provides them with a unique download link to your digital product.
  • Automatically expiring links as required by the user.
  • File Attachments in Email.
  • Easy to test and debug.
  • Easy to integrate into any existing website.
  • Easy to install and configure. Only one settings file.

IPN is what this system is designed around.Instant Payment
Notification (IPN) allows you to integrate PayPal payments with your
website’s back-end operations. IPN provides immediate notification and
confirmation of PayPal payments you receive. Here is how IPN works

How IPN Works

  • A customer payment or a refund triggers IPN. This payment can be
    via Website Payments Standard FORMs or via the PayPal Web Services
    API’s for Express Checkout, Mass Pay, or Refund Transaction. If the
    payment has a “Pending” status, you receive another IPN when the
    payment clears, fails, or is denied.
  • PayPal posts HTML FORM variables to a program at a URL you specify.
    You can specify this URL either in your Profile or with the notify_url
    variable on each transaction. This post is the heart of IPN. Included
    in the notification is the customer’s payment information (such as
    customer name, payment amount). All possible variables in IPN posts are
    detailed in this guide. When your server receives a notification, it
    must process the incoming data.
  • Your server must then validate the notification to ensure that it
    is legitimate.Once this is verified you can go ahead and deliver the
    goods with a link which expires after sometime to the payer.

To activate IPN, you can either change a setting in your PayPal
Profile or include the notify_url variable in the payment FORMs on your
website. We will us the notify_url method.

Also as we will not be using any encryption in the buttons we will
verify all the IPN details during the verification procedure.

Before you begin this tutorial please download the source and refer to it side by side for better understanding.

Step 1 : Setting up to receive and validate IPN
request . We are going to use one of the many Paypal Classes available
freely, I have taken one from micah carrick
.This class handles the request which Paypal send back to us.So the
validation code which will be called once the Paypal invokes our IPN.
validate_ipn() is the function which handles this part.

Step 2 : Now we want do define the products which
we want to sell , As my aim was to sell 1 - 2 odd scripts there was no
use of building a shopping cart. Also as i planned to skip the database
, and keep things simple as possible. So my products listing is a
simple array defined in the settings.php file. The array item index is
the item number which is used when creating a button.

// product[number] = array(’Name’ ,’Price’ , ‘Download Link’);

$products[2] = array(’My Script’,’32′,’downloads/myscript.zip’);

Step 3 : As we will be using non encrypted buttons
, users might try to fool the script by sending in fake IPN requests or
paying different amount and invoking the IPN script. To prevent such
kind of things from happening we put in a validation function which
checks various parameters according to our defined products. This
function is validate_product().

Step 4 : Now we need a Buy now button for our
product which defines our IPN callback, Item number , price etc. This
button is simple HTML and can be placed anywhere and all the user is
required is to click it and pay up , rest the script will take care of.

<form action=”https://www.sandbox.paypal.com/cgi-bin/webscr” method=”post”>

<input type=”hidden” name=”cmd” value=”_xclick”>
<input type=”hidden” name=”business” value=”mail@mybusiness.com”>

<input type=”hidden” name=”item_name” value=”My Ebook”>
<input type=”hidden” name=”item_number” value=”2″>
<input type=”hidden” name=”amount” value=”32.00″>
<input type=”hidden” name=”rm” value=”2″>

<input type=”hidden” name=”return” value=”http://www.mybusiness.com/thankyou.html”>
<input type=”hidden” name=”cancel_return” value=”http://www.mybusiness.com/”>
<input type=”hidden” name=”notify_url” value=”http://www.mybusiness.com/paypal/paypal.php”>

<input type=”image” src=”https://www.paypal.com/en_US/i/btn/x-click-but23.gif” border=”0″ name=”submit” alt=”Make
payments with PayPal - it’s fast, free and secure!”>
<img alt=”” border=”0″ src=”https://www.paypal.com/en_US/i/scr/pixel.gif” width=”1″ height=”1″>
</form>

Step 5 : Now if everything goes fine and user pays
up we need to send him a secret link which expires at our pre decided
time( say 24 hours ). Now this procedure will only takes place if the
IPN return a verified value. The secret link just contains a timestamp
and a product ID which is encrypted using RC4 encryption and then base
64 Encoded so that it can be used in a URL. Then a email is sent to the
user with the Download link.

// Client has successfully paid for the product

$product_id = $p->ipn_data[’item_number’];

$download = $product_id.’|’.time();

$download_link = $script_location.’download.php?file=’.base64_encode(RC4Crypt::encrypt($secret,$download));

Step 6 : Now we need a script which takes this link
and validates it and gives the user the download if everything goes
fine. download.php is the file which does this.

That’s it , you have a set of 2 scripts which will allow you to sell downloads online.

The package also includes a check.php which helps you check if Digisell is functioning properly. Run it after you have editing the settings file.


About

You are currently browsing the NGCoders - Next Generation Coders weblog archives for the 'Downloads' category.

Categories

Subscribe