Socket Programming.zip

Building a Basic DNS Server in PHP/Python: A Beginner's Guide

731

Creating a full-fledged DNS server in PHP is not recommended for production environments due to performance and security concerns. DNS servers require low-level networking capabilities and efficient handling of DNS protocol messages, which PHP is not optim...

PHP socket programming to get content with post method

407

When you need to get content with POST method in PHP internal code, you need to get the desired result through alternate socket programming as below.Actually what I wanted is emailing through alternate server located in different domain, because the curren...

How do I determine the client IP type (IPv4/IPv6) in PHP

828

In the PHP, there are filters which can determine IPv4 and IPv6: FILTER_VALIDATE_IP, FILTER_FLAG_IPV4, FILTER_FLAG_IPV6.Below code shows how to determine the client protocol:This code snippet checks whether the client's IP address is IPv4 or IPv6 using fil...

How do I determine the client IP type in Python - IPv4 or IPv6

758

We can determine IPv6 and IPv4 based on its separator character. IPv4 uses period(.) and IPv6 uses colon(:).Below code shows how to determine the client protocol In this Python code:We import the socket module.We use socket.getaddrinfo() to get the IP...

Building a Simple DNS Server in Delphi with TTL Support

676

Below is a basic Delphi code example to implement a DNS server capable of handling A, AAAA, CNAME, and TXT records with Time-To-Live (TTL) support. This example uses the IdUDPServer component from Indy (Internet Direct) library for handling UDP packets.Thi...

Dynamic DNS Made Easy: Building a Python-Based Solution

793

Creating a dynamic DNS (Domain Name System) service in Python involves several components: a server that listens for DNS queries, a database to store mappings between domain names and IP addresses, and functionality to update these mappings dynamically. Be...

Exploring the Depths of Data Transfer: sendfile vs. kTLS

Exploring the Depths of Data Transfer: sendfile vs. kTLS

1,314

When optimizing the performance of web servers and ensuring secure data transmission, two technologies often come into play: sendfile and Kernel TLS (kTLS). Both are designed to enhance efficiency in different ways, primarily in the context of sending data...

Enable/Disable IPv6 on Windows

1,728

Even though IPv6 is one of the key features by the most of network service providers, but its network equipments are not stable accordingly, so we face a lot of connectivity issues from time to time. Sometimes, it is recommended us to turn IPv6 off for sta...

Public DNS (Domain Name Service) based on IPv4, IPv6 widely used

Public DNS (Domain Name Service) based on IPv4, IPv6 widely used

1,239

In most cases,the Dynamic Host Configuration Protocol (DHCP) automatically configures your system to use the IP addresses of your ISP's domain name servers.To use Public DNS,you need to explicitly change the DNS settings in your operating system or device ...

Configuring IP Address on Centos 6.7

783

On Centos 6.7,you can check IP address configuration by ifconfig command as below: .The below is the example of files on " / etc / sysconfig / network-scripts". Among above,ifcfg-eth0 and ifcfg-eth1 is wired network,and below is the reference example: .If ...

How to convert formatted date time string to datetime?

443

Whatever the formatted string is,strtotime() function convert the formatted date time string to datetime.Following example shows the simple reference can convert date time string whatever the formatted input is.

Retrieving all image links from an HTML document

416

Here's how to obtain all image links from an HTML document.The GetImageLinks procedure fills a TStrings object with the value of the SRC property of the IMG HTML element.Note: if the images have relative links,you will have to parse the document url and pr...

List All Network Drives

389

To show a list of all mapped network drives,use the GetNetworkDriveMappings function.Example usage: .

How to get get IE favorites

448

The GetIEFavourites function called from the OnClick event of a button returns a list of all the favorites from your Internet Explorer in a ListBox.

Download a file from the Internet with progress indicator

550

If you need to save the contents of a specified URL to a file - and be able to track the download progress,use the TDownLoadURL.While TDownLoadURL is writing to the specified file,it periodically generates an OnDownloadProgress event,so that you can provid...

Adding and Subtracting Time

553

The time () function generates a long string of numbers representing how many seconds have passed since January 1, 1970. It is possible to add and subtract time by adding and subtracting seconds.

The three simplest regular expressions you will use in PHP

580

The three most basic searches using regular expressions are searching for the strings start, the strings end, or for characters it contains. We can do these using the following symbols:^ indicates the string starts with the specified characters, so "^strcp...

Number Format

481

In this article we'll make number format like 0001, 0002, 0003 in stead of 1, 2 ,3. It's very easy to do this for your counter, category or product ID. etc.

A Function Returns Large Random Numbers

425

This basically randomly pick a number between the min and max values. This is made because the rand() and mt_rand() function can not accept numbers larger than 2^31 or 2^63,depend on your processor and complier.

Function AccountCryptPassword($password,$salt)

724

Encryption and password account accessFunction AccountCryptPassword($password,$salt) {  if($salt=="")  {   srand(time());   $random=rand();   $itoa64=". / 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; ...

Cardinal Endings

490

This php based script will find numbers and give them a cardinal ending.This can be useful for displaying rankings or results of a competition.The script is easy to install and use .Explanation::addOrdinalSuffix($number): This function adds the appropriate...

URL Rewriter PHP

612

URL Rewriter PHP is a short code that can be used to rewrite dynamic PHP urls as URL's that link to static htmlpages.Increases search engine rankings by creating a static system of page linking as well as making all content available. Associated Data for U...

Browser detection in PHP

735

Sometimes, you may want to know what kind of browser is connecting to your web site. Actually such kind of information is usually stored in $_SERVER.  Below is the reference: