The short answer is, yes. Now the long answer..
when most people talk about programming they have this complex algorithm, thousands of lines of code, weird looking flocharts in mind, and more often than not this raises a questions whether such complex subject is even possible to master without attending college, taking computer science program or being taught from some guru
I get dozens of questions from people asking how to learn programming? what's the best resource to learn programming? and so on.. I ask these guys, why would you like to learn programming? they say, I want to build website, then I ask, what website?, I get a response something along the lines that they want to be able to build any website. Right there I know even if these people started programming right now and came back after 5 years, they would still be wondering around, learning random things from random videos, making random small programs.
Now here is another guy. He wants to build a page to collect email addresses for marketing purpose. Right there half of his learning is done.. this guy is far more likely to understand and learn programming than the other dude who is still lost.. not to mention both of these are amateurs, except one has a vision of what he wants to do, is well aware of his ultimate goal, while other guy is looking for something that may along the way define his ultimate goal.
Another, difference between this guy and the previous guy is, this guy right here will not bother clicking on links like Can you really learn programming on your own? he knows what exactly he wants, all he needs is a path to get there. Instead the question he may ask is, how to build this.
To answer the title of this post Can you really learn programming on your own? I will raise a counter question, what is it exactly that you would like to build after you know programming? when you have answered this question, half of your puzzle will be solved, and to solve another half, I am going to link you to this guy.
Now lets do a little time travelling.. theory or techniques you may have missed from not taking CS course, will come and block your way down the road and force you to learn. It does not really matter whether you learn them now or later on, fact of the matter is, as you get better and better, you will be forced to learn it all, your goals will make you do it, now it will become your own choice whether you want to be taught or you can figure things out to acomlpish your goals yourself.
Wednesday, 14 October 2015
Sunday, 11 October 2015
How to verify data integrity using MD5 cryptographic algorithm
What is MD5 you ask?
MD5 stands for message digest 5. It's an algorithm used to create data digest to verify it's integrity. Just like every human being has unique fingerprint, every file that goes through this algorithm brings a fixed length hash, this hash cannot be reversed.What's the use of MD5?
MD5 is most commonly used to hash user password and data verification. When user signs up to a website his password is hashed, and stored in the database, when user tries to login, his password is again hashed and matched against the hash stored in database. So even if his website database is compromised, hacker wouldn't be able to see the passwords, thought this doesn't mean your data is completely secure, more often than not users use common passwords like 123456, 00000 etc.. hacker would simple use a dictinary of common known hashes to crack down your password, so it's very important that your suggest user to choose as strong password as possible.How does data verification work with MD5?
Data verification or data integrity check work by creating a digest or hash of a certain application/file, every digest generated by MD5 is unique. For example, lets say you've made a file avilable for download, how would the users know whether someone who's linking to a mirrored download is a genuine file and not some virus attached to original file? Well that's where MD5 comes into play, you can compute an hash of your application and post it on your website, now whenever someone downloads it from your or someone else's website he would use a utility like Microsoft file checksum integrity verifier to compute a hash for either MD5 or SHA1, and compare it against the hash that was provided on your original website, if the hash is same, the file's exact as the original one, else, something in that file has been modified.Friday, 25 September 2015
What's a Proxy server and how it works for absolute beginners
Figured I'd write a little article on this since there's so many people
that seem to be working with proxies without really knowing what it
really is and how it works.
-
First things first, for those who don't know what a proxy is, it's a computer, to be more specific, it's a computer running apache or other server software, and those who don't know what apache is, it's a piece of software that runs on a computer which allows a client software to request data from your server using URL. Client software is your web browser. We generally call is 2 tier architecture, this is, client(browser) taking care of presentation and client side data manipulation, and server doing it's job behind the scene in the computer running apache software.
I won't talk about DNS server, but essencially whenever you type URL in address bar and press enter, that URL is translated into IP address AKA dotted squad - DNS does this, it's where the www.example.com address is matched with associated with IP. Then this IP is sent back to your browser and browser then sends requests to it and waits for response back from apache server.
Client server model(picture from pecktechdesigns.com):
![[IMG]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_tDoqbuxCS7VxJ470aruvNvHLvaOOa2mIZJQ_oDkIkvg5Q1kpCdwi6wRZJaEiUtTIoYsHxKpNSNMgvFb-JW18JNnvQeP2eJFUkwP5bjrJWKRXtrv1jAUvsjQTvpLTj4gu0v0kWpbA=s0-d)
So here we've clients making requests to the server, using HTTP(read more about this protocol here).
Alright so far so good. We've client, it has a regular IP, and we've a server which also has an IP, right. But what if we want to change client's IP. That is where proxy server comes in, you take a server place it between client and server.
So this is how it looks like(picture from forrester-infosystems.wikispaces.com):
![[IMG]](https://forrester-infosystems.wikispaces.com/file/view/Proxy_graphic.jpg/216620300/409x369/Proxy_graphic.jpg)
Internet = A computer running apache software.
Server = Web server where you're making requests, server where files or webpage are located.
As you see here, left side computers are clients, middle one is a our new server, and Internet(right side one) is our web server. So whenever the client makes a request for anything from Internet, it goes through the Proxy Server. Proxy server is a new server that's been placed between client and Internet so whatever you do, will go through it. For instance, if you try to visit a website and it's blocked, you should know it was the Proxy Server that dected something in your request. Or look at this one, someone's trying to hack your computer, he wont just be able to go and attack your computer directly, he'll have to go through proxy server. Or check this one out, you're on a little local network that uses proxy server, your server administrator could configure your Proxy Server to cache webpages.. so whoever after you tries to visit the same webapage, will get it without the need to download it again.
Okay so if you're still reading, then keep reading before it's about to get interesting here. When you tell your browser to connect to certain proxy server, lets say you're connected to 1.1.1.1.1.1 server, which's a proxy server, what this server will do is send your request to the server you're requesting data from, while at it, it will hide your IP address and give the requesting server it's own IP address(1.1.1.1.1.1). So basically if your address is 2.2.2.2.2.2, it's giving the server 1.1.1.1.1.1.1.
Check this picture out, we've a Proxy Server located in US which has US IP so whenever you're making request to webpage using that server, that seerver will request the data for you, not letting the web server about your IP. Example, lets say you're making bunch of spammy comments on thebot.net money making website, trying to promote your new blog.. you've been doing this or a day and the administrator has finally noticed it. Now administrator goes to his log file and looks up IP address associated with your account. He wont see your IP address, he'll see this proxy server's address. Lets say he finally decided to block this Proxy Server. What can you do now is simple switch your Proxy Server and you're live again.
Picture from(anfieldroad.com):
![[IMG]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_uiPl-lC0cckA7MfwRRg9jGDSTdDs6D6_K2LhpUcm_d1rkvqyBviC9KWddJei_5p1xhkCp5kzKYraqgjmocnP0hGyUoOFvl0kOzPb2bLHbCug_uSvz-hG7iEUHQjDt_n6RhbND_-0KP-RSgq9M0Ph9J-fpz=s0-d)
Still reading? Lets make it a even more tricky here. What if you wanted to hide behind multiple Proxy servers? There's a way to do it, there's plenty of sevices that offer hops, it's basically connecting to A proxy server, which's connected to B, which to C and then C finally to your destination server. Making it even more complex to track the source of client/request back.
But remember like I said in the beginning, Proxy server is just a computer. So when you request data from www.example.com through Proxy Server, the Proxy server is sending request to Server, requesting data for you, then uploading that data to your computer. Which mean, faster Proxy Server's internet connection. The faster the process will happen.
-
First things first, for those who don't know what a proxy is, it's a computer, to be more specific, it's a computer running apache or other server software, and those who don't know what apache is, it's a piece of software that runs on a computer which allows a client software to request data from your server using URL. Client software is your web browser. We generally call is 2 tier architecture, this is, client(browser) taking care of presentation and client side data manipulation, and server doing it's job behind the scene in the computer running apache software.
I won't talk about DNS server, but essencially whenever you type URL in address bar and press enter, that URL is translated into IP address AKA dotted squad - DNS does this, it's where the www.example.com address is matched with associated with IP. Then this IP is sent back to your browser and browser then sends requests to it and waits for response back from apache server.
Client server model(picture from pecktechdesigns.com):
So here we've clients making requests to the server, using HTTP(read more about this protocol here).
Alright so far so good. We've client, it has a regular IP, and we've a server which also has an IP, right. But what if we want to change client's IP. That is where proxy server comes in, you take a server place it between client and server.
So this is how it looks like(picture from forrester-infosystems.wikispaces.com):
![[IMG]](https://forrester-infosystems.wikispaces.com/file/view/Proxy_graphic.jpg/216620300/409x369/Proxy_graphic.jpg)
Internet = A computer running apache software.
Server = Web server where you're making requests, server where files or webpage are located.
As you see here, left side computers are clients, middle one is a our new server, and Internet(right side one) is our web server. So whenever the client makes a request for anything from Internet, it goes through the Proxy Server. Proxy server is a new server that's been placed between client and Internet so whatever you do, will go through it. For instance, if you try to visit a website and it's blocked, you should know it was the Proxy Server that dected something in your request. Or look at this one, someone's trying to hack your computer, he wont just be able to go and attack your computer directly, he'll have to go through proxy server. Or check this one out, you're on a little local network that uses proxy server, your server administrator could configure your Proxy Server to cache webpages.. so whoever after you tries to visit the same webapage, will get it without the need to download it again.
Okay so if you're still reading, then keep reading before it's about to get interesting here. When you tell your browser to connect to certain proxy server, lets say you're connected to 1.1.1.1.1.1 server, which's a proxy server, what this server will do is send your request to the server you're requesting data from, while at it, it will hide your IP address and give the requesting server it's own IP address(1.1.1.1.1.1). So basically if your address is 2.2.2.2.2.2, it's giving the server 1.1.1.1.1.1.1.
Check this picture out, we've a Proxy Server located in US which has US IP so whenever you're making request to webpage using that server, that seerver will request the data for you, not letting the web server about your IP. Example, lets say you're making bunch of spammy comments on thebot.net money making website, trying to promote your new blog.. you've been doing this or a day and the administrator has finally noticed it. Now administrator goes to his log file and looks up IP address associated with your account. He wont see your IP address, he'll see this proxy server's address. Lets say he finally decided to block this Proxy Server. What can you do now is simple switch your Proxy Server and you're live again.
Picture from(anfieldroad.com):
Still reading? Lets make it a even more tricky here. What if you wanted to hide behind multiple Proxy servers? There's a way to do it, there's plenty of sevices that offer hops, it's basically connecting to A proxy server, which's connected to B, which to C and then C finally to your destination server. Making it even more complex to track the source of client/request back.
But remember like I said in the beginning, Proxy server is just a computer. So when you request data from www.example.com through Proxy Server, the Proxy server is sending request to Server, requesting data for you, then uploading that data to your computer. Which mean, faster Proxy Server's internet connection. The faster the process will happen.
Sunday, 6 September 2015
Free e-commerce website | Paypal Payment Options
Completely free of charge ecommerce script | No no hidden costs | Under GNU/GPL license.
This is a small e-commerce website that allows you to sell up-to 4 products. It comes with Admin Panel where you're allowed to Add or Remove Product. Admin Panel also allows you to set the receiver Paypal along with site template information like site title, header, footer logo etc..
IMPORTANT: Just after editing the database information in conn.php file and connecting to database, and importing SQL files your first priority should be to open admin table and edit the user and password. Md5 hash your password when you paste it in password field in database. To md5 just search on google for md5 hash generator and generate your password using it. Then when loggin in, just use regular password.
Rest of it is easy. Once you're in Admin Panel, you'll see three buttons, Add Product, Delete product and Add Site Info. To add a product just click on Add Product button, fill all the details and press enter.
Note that it wont allow you to add any more products than 4. If 4 products are already in database you'll be asked to delete atleast one product.
The Add Site Info button will also allow you to add your Paypal.
And to use the Delete Product option just click the button and you'll be presented with links of your product. To delete a product, just click on it and it'll be deleted.
Make sure atlease 4 products are available on website, or a message will appear asking you to add the missing product.
Also make sure required bootstrap files are not deleted, this site uses bootstrap for document styling and structure.
Lastly, use the script at your own risk.
Script developed by | - samiuddin | phpdevsami@gmail.com | http://wwww.webdevtown.com | https://github.com/phpdevsami
Download
https://dl.dropboxusercontent.com/u/28490184/webdevtown/ecommerce_site.rar
Screenshorts
Tuesday, 25 August 2015
Javascript to mass follow users on twitter!
Well as we all know, social media's become one of the thing your site cannot live without. In this quick post I'll show you guys how to mass follow twitter users.
Here's how it's done.
1. Open a well known user's profile and click on followers.
Now you will see a big list of people that company/person is following. You will also notice the 'following' blue button, which ofcourse are meant to be used to follow these people. Now there should be plenty of people and following each and everyone manually would be just a waste of time.
So to prevent that from happening, we're going to use client side scripting language Javascript! What we're going to do is following.
1. We're first going to target all the buttons using document.getElementsByClassName.This method will return an index array with each user's following button link.
2. Next we're going to use for loop and loop through that array. While doing so, we're also going to use .click method to click each 'following' button.
Here's the script. Just paste this in your web console and run it. Every time you click the run button page will be scrolled down, so you can continue following people. If it says undefined, it means you're on a wrong page and it couldn't find the element that we're asking it to look for.
var inputs = document.getElementsByClassName('button-text follow-text');
$(document).scrollTop($(document).height());
for(var i=0; i<inputs.length; i++){
inputs[i].click();
}
Here's how it's done.
1. Open a well known user's profile and click on followers.
Now you will see a big list of people that company/person is following. You will also notice the 'following' blue button, which ofcourse are meant to be used to follow these people. Now there should be plenty of people and following each and everyone manually would be just a waste of time.
So to prevent that from happening, we're going to use client side scripting language Javascript! What we're going to do is following.
1. We're first going to target all the buttons using document.getElementsByClassName.This method will return an index array with each user's following button link.
2. Next we're going to use for loop and loop through that array. While doing so, we're also going to use .click method to click each 'following' button.
Here's the script. Just paste this in your web console and run it. Every time you click the run button page will be scrolled down, so you can continue following people. If it says undefined, it means you're on a wrong page and it couldn't find the element that we're asking it to look for.
var inputs = document.getElementsByClassName('button-text follow-text');
$(document).scrollTop($(document).height());
for(var i=0; i<inputs.length; i++){
inputs[i].click();
}
Mini traffic exchange script no database or PHP required!
I wrote this traffic exchange script.
Here's how it works.
You as the owner would add all exchangers website in the links array. When done, just upload the script to your server and tell people to leave your website open. Every user then will start getting traffic, from random users whoever is part of exchange.
Website will randomly choose any link from link array and open it, it will refresh the page every 15 seconds - opening random website from the list every time. Note that it's very important that there's plenty of people/exchangers on your webpage, the links in array don't need to be many, it depends on who wants to exchange traffic, every link from array will get traffic, just make sure there's enough people on your webpage where you uploaded the script. Whoever's in links array will get traffic, the point of having as many users load the website and leave it open is to get traffic from different users.
TOS: For more scripts visit <a href="http://www.webdevtown.com"> Web development town </a> part must stay intact.
Script
<html>
<head>
<meta http-equiv="refresh" content="15" />
<title id="title"> </title>
Users online:
<script language="JavaScript">
var fhs = document.createElement('script');var fhs_id = "5050013";
var ref = (''+document.referrer+'');var pn = window.location;var w_h = window.screen.width + " x " + window.screen.height;
fhs.src = "http://freehostedscripts.net/ocounter.php?site="+fhs_id+"&e1=0&e2=Online Users&r="+ref+"&wh="+w_h+"&a=1&pn="+pn+"";
document.head.appendChild(fhs);document.write("<span id='o_"+fhs_id+"'></span>");
</script>
</head>
<body>
<iframe id="website" src="" style="visibility:hidden; display:none"></iframe>
<script>
var links = [
"http://www.thebot.net",
"http://www.webdevtown.com"
];
var item = links[Math.floor(Math.random()*links.length)];
var change_value = document.getElementById("website").src = item;
var change_title = document.getElementById("title").innerHTML = "Viewing: " + item;
</script>
</br>
For more scripts visit <a href="http://www.webdevtown.com"> Web development town </a>
</body>
</html>
Here's how it works.
You as the owner would add all exchangers website in the links array. When done, just upload the script to your server and tell people to leave your website open. Every user then will start getting traffic, from random users whoever is part of exchange.
Website will randomly choose any link from link array and open it, it will refresh the page every 15 seconds - opening random website from the list every time. Note that it's very important that there's plenty of people/exchangers on your webpage, the links in array don't need to be many, it depends on who wants to exchange traffic, every link from array will get traffic, just make sure there's enough people on your webpage where you uploaded the script. Whoever's in links array will get traffic, the point of having as many users load the website and leave it open is to get traffic from different users.
TOS: For more scripts visit <a href="http://www.webdevtown.com"> Web development town </a> part must stay intact.
Script
<html>
<head>
<meta http-equiv="refresh" content="15" />
<title id="title"> </title>
Users online:
<script language="JavaScript">
var fhs = document.createElement('script');var fhs_id = "5050013";
var ref = (''+document.referrer+'');var pn = window.location;var w_h = window.screen.width + " x " + window.screen.height;
fhs.src = "http://freehostedscripts.net/ocounter.php?site="+fhs_id+"&e1=0&e2=Online Users&r="+ref+"&wh="+w_h+"&a=1&pn="+pn+"";
document.head.appendChild(fhs);document.write("<span id='o_"+fhs_id+"'></span>");
</script>
</head>
<body>
<iframe id="website" src="" style="visibility:hidden; display:none"></iframe>
<script>
var links = [
"http://www.thebot.net",
"http://www.webdevtown.com"
];
var item = links[Math.floor(Math.random()*links.length)];
var change_value = document.getElementById("website").src = item;
var change_title = document.getElementById("title").innerHTML = "Viewing: " + item;
</script>
</br>
For more scripts visit <a href="http://www.webdevtown.com"> Web development town </a>
</body>
</html>
Monday, 24 August 2015
Detect HTTP request type in PHP using $_SERVER array variable
$_SERVER is an array containing data such as HTTP headers, paths, and script locations. Basically server and execution environment information. This information is generated by your web server.
So if you var_dump($_SERVER), you will notice a big associate array where you can dig for specific information. So by using the array key 'REQUEST_METHOD', the method being used is returned.
You can either use if else statements or switch statements. Just provide it with method type variable and use case statements to take different actions upon different method types.
Here's a quick example.
Another basic way to check the HTTP method type is using the isset function with supergloabal variables(variables available in all scopes). Like $_POST or $_GET. So we end up with something like,
if(isset($_POST){
//do this..
}
So if you var_dump($_SERVER), you will notice a big associate array where you can dig for specific information. So by using the array key 'REQUEST_METHOD', the method being used is returned.
You can either use if else statements or switch statements. Just provide it with method type variable and use case statements to take different actions upon different method types.
Here's a quick example.
switch ($method) { case 'PUT':
break; case 'POST':
break; case 'GET':
break; }Another basic way to check the HTTP method type is using the isset function with supergloabal variables(variables available in all scopes). Like $_POST or $_GET. So we end up with something like,
if(isset($_POST){
//do this..
}
Subscribe to:
Posts (Atom)






