In a post, I told how to create a localhost website using Apache server in Ubuntu. It worked on all versions up to Ubuntu’s 10.10th version. But on Ubuntu versions 11.04 and the versions released after it, there were some changes to the Apache server. So, by this post I’m going to update the way to create a localhost hosted website in Ubuntu versions 11.04 and the versions that came after 11.... [READ MORE]
Posts marked with "Posts" in posts
Identify Remote OS By IP Address In PHP
In the recent post, I gave the default TTL value of different devices. As you can see, when you ping a host you can roughly identify the operating system the remote server’s running. I saw a question on Stack Overflow about this. Sadly it was down voted and was removed later. I tested if it is possible and I found that it is possible. In this post, I will give a function that automatically pings the remote host and find out the possible Operating Systems the remote server is running.... [READ MORE]
Default TTL (Time To Live) Values of Different OS
TTL (Time To Live) is a timer value included in packets sent over networks that tells the recipient how long to hold or use the packet before discarding and expiring the data (packet). TTL values are different for different Operating Systems. So, you can determine the OS based on the TTL value. You can get the TTL value by pinging an address. Here is the output got by pinging “subinsb.com” on my system :... [READ MORE]
Create SVG Images In Inkscape Without Transforms
Inkscape is a beautiful Open Source Image editing software. It can be used to create PNG images, JPG images and even SVG images. But, when you export an SVG image, it will have some kind of transform style in it such as translate. This will make the SVG image code so long. To make it short, it’s better to remove the transform on the image and save it as it should be.... [READ MORE]
Delete Items From JSON or Remove Variables in JavaScript
In PHP, you can directly remove an item from an array using unset function. But there is no unset function in JavaScript. But there is another function that will remove a variable. It’s called delete. Removing variables isn’t the only thing it does. It can also remove items from a JSON array in JavaScript. It’s usage is simple. Just pass the array variable with the name of the key. Like this :... [READ MORE]
Add Spell Check With PHP Using Google
If you google something that has spelling mistakes, Google will automatically correct it for you or if the bot isn’t sure, it will give the Did You Mean ? clause. If you’re developing a search engine for your site, this spell check will come in handy. If the user had made a mistake and he was shown a “No Results Found” page, user will be annoyed. So, it’s better to have a spell check for your site.... [READ MORE]
Create a Search Engine In PHP, MySQL | Part 3
This is the Part 3 of “How To Create A Search Engine In PHP”. In this part, We make additional adjustments and make the search engine more awesome and cool. DownloadDemo Bot Page Our crawler leaves a mark on every pages it visit. In other words a custom User Agent String goes with each requests to web pages. In the previous part, we set the user agent string as :... [READ MORE]
Create a Search Engine In PHP, MySQL | Part 2
This is the Part 2 of “How To Create A Search Engine In PHP”. In this part, We’ll add code to files that are being displayed to the users. We make the database and the table in this part. DownloadDemo index.php The main page of our Web Search is index.php. It has a simple design and is not very advanced as Yahoo or something else. <?include("inc/functions.php");?> <html> <head> <?head("", array("index"));?> </head> <body> <?... [READ MORE]
Create A Search Engine In PHP, MySQL | Part 1
When we all search on the web using Google, Yahoo or Bing, we are curious about how it works and how it gets all the information on the web. When us programmers started coding, we all wanted to create a search engine. I too attempted to create a search engine and I ultimately failed (3 years back). But now, I improved my coding skills, improved my knowledge and ideas. So, I decided to create a new search engine with automatic crawling, indexing and stuff.... [READ MORE]
MySQL NOW() in JavaScript (UTC & Local)
If you know MySQL, you will certainly know the NOW() function that outputs the current date and time with the timezone of the MySQL server. For easy use and compatibility, we use UTC time zone for storing time in database. If you are running a web app that comply with MySQL, then you need the date function as same as the NOW(). So, I will give you a small function that return the same value as MySQL’s NOW() function in both UTC and local time.... [READ MORE]