Screen Resolution 1440 x 900 in Ubuntu

Ubuntu 9.04 did not detect the native resolution of my new LCD monitor which was 1440 x 900. Fix : 1. Get the modeline for the required resolution + refresh rate using the gtf command. desktop:~$ gtf 1440 900 75 # 1440x900 @ 75.00 Hz (GTF) hsync: 70.50 kHz; pclk: 136.49 MHz Modeline "1440x900_75.00" 136.49 1440 1536 1688 1936 ...

Code raw sockets in C on Linux

Raw tcp sockets in C Raw sockets can be used to construct a packet manually inside an application. In normal sockets when any data is send over the network, the kernel of the operating system adds some headers to it like IP header and TCP header. So an application only needs to take care of what data it is sending and ...

SYN Flood DOS Attack with C Source Code (Linux)

TCP/IP 3-way handshake is done to establish a connection between a client and a server. The process is : 1. Client --SYN Packet--> Server 2. Server --SYN/ACK Packet --> Client 3. Client --ACK Packet --> Server The above 3 steps are followed to establish a connection between source and destination. SYN Flood DOS attacks involves sending too many SYN packets (with a bad or random ...

15 Best free games on Ubuntu Linux

As linux is becoming popular more and more games are becoming available for the platform. And lots of them are already available on ubuntu. In this post lets check out some of the most popular games on Ubuntu that are really entertaining and fun to play. Enjoy them in your free time. 1. SuperTuxKart - Racing Game Supertuxkart is a racing game ...

PHP: Get visitor’s location, city, country from IP address

Ip to Location Many applications need to get information about the geographical location of the user/visitor on their websites. This can be done in many ways. There are online services like ipinfodb and geoio that provide web based api to get the geolocation information about a given ip address. Services like Maxmind geoip provide free database that can be installed on ...

Parse and change date format in php

Parsing dates Most php applications need to parse dates and convert them to timestamps for example. Parsing is also necessary to convert the date into a more standard format like yyyy-mm-dd which can be stored in a database like mysql. Mysql database stores dates in the format yyyy-mm-dd like 2009-04-15. However humans are more used to the formats like dd-mm-yyyy or mm-dd-yyyy ...

PHP Database Class to access Mysql

This is a simple class that evolved out of the php code I wrote so far. It has the following functions : 1. dbms() - The constructor to do the initialisation like connecting to the database etc. 2. query($query) - The method to take a sql string and perform the query. 3. close() - Close the database connection 4. backup() - Create a backup of ...

Restore Mysql Database from a sql or zip file using PHP

In a previous post we learnt how to inside php. In this example the same zip file would be used to restore the database. Code // Function to restore from a file function restore($path) { $f = fopen('restore/temp.sql' , 'w+'); if(!$f) { echo "Error While Restoring Database"; return; } $zip = new ZipArchive(); ...

Backup mysql database with php and zip it

Many php applications prefer to backup the mysql database from within the application and save it as an archive. The mysqldump commandline utility can be used to perform this function of backing up a mysql database as sql file. The command would be like this : mysqldump --user=$username --password=$password --opt $db_name > $dir/backup.sql The above command shall dump the database named $db_name ...

TCP Connect Port Scanner Source Code in C with Winsock

Tcp connect port scanning TCP connect() scanning is the most basic form of TCP scanning. The program performs a connect() command on those ports of the target machine which are to be checked. If the port is open then the connect() command will succeed and a connection will be established. If the port is closed the connect() function would simply timeout ...



Connect with us